]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: avoid confusing use of ai_protocol=IPPROTO_IPV6
authorWes Campaigne <westacular@gmail.com>
Tue, 22 Feb 2011 00:10:10 +0000 (19:10 -0500)
committerJan Engelhardt <jengelh@medozas.de>
Tue, 22 Feb 2011 02:54:28 +0000 (03:54 +0100)
[Split hunk from Wes's submission. Added commit message. -j.eng]

ai_protocol normally specifies the L4 protocol one wants to
specifically inquire about when a service (2nd parameter to
getaddrinfo) is specified. Such a service lookup would potentially
yield nothing, because there just is not any "mytunnel 2222/ipv6" in
/etc/services, since IPPROTO_IPV6 itself is not a protocol with a
concept of (port-based) services to begin with.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
xtables.c

index f66fb275e13bb098a4b7f0c1d03a3ba1a5807807..83c5b41f5d47ff98dd66430ca80e3a3ba2c0f00e 100644 (file)
--- a/xtables.c
+++ b/xtables.c
@@ -1424,8 +1424,6 @@ host_to_ip6addr(const char *name, unsigned int *naddr)
        hints.ai_flags    = AI_CANONNAME;
        hints.ai_family   = AF_INET6;
        hints.ai_socktype = SOCK_RAW;
-       hints.ai_protocol = IPPROTO_IPV6;
-       hints.ai_next     = NULL;
 
        *naddr = 0;
        if ((err = getaddrinfo(name, NULL, &hints, &res)) != 0) {