httpd: fix address family for reverse proxy client socket
authorLaurent Bercot <ska-dietlibc@skarnet.org>
Fri, 6 Jan 2017 21:03:08 +0000 (22:03 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 8 Jan 2017 14:14:38 +0000 (15:14 +0100)
commit0ef478f01bb3d42f6776f58fb5891e1430af8799
treed40e5517fc23296473e4a3ad95f7f04386e78ce4
parent4d06b314532f7f52a9d8a5d6b7dcafaf00ff1334
httpd: fix address family for reverse proxy client socket

When httpd proxies a request to another server, it first creates
an AF_INET socket, then resolves the server name to a sockaddr,
then connects to it. This fails if the server name resolves to
an IPv6 address.

This patch ensures that the socket is created with the correct
address family (AF_INET6 if the server resolves to an IPv6 address
and AF_INET otherwise).

Signed-off-by: Laurent Bercot <ska-dietlibc@skarnet.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/httpd.c