]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: provide IPv6 zero address variable
authorJan Engelhardt <jengelh@medozas.de>
Fri, 3 Apr 2009 20:40:35 +0000 (22:40 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 3 Apr 2009 20:40:35 +0000 (22:40 +0200)
µClibc may not provide the in6addr_any variable when IPv6 is
disabled. So just provide it ourselves.

Reference: http://bugzilla.netfilter.org/show_bug.cgi?id=569
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
xtables.c

index 044603f93aa2c10f9f097a7e74d55348e366c48b..a01d4ea0106fb5d9d929dba64c04f14728950c92 100644 (file)
--- a/xtables.c
+++ b/xtables.c
@@ -1367,6 +1367,7 @@ static struct in6_addr *parse_ip6mask(char *mask)
 void xtables_ip6parse_any(const char *name, struct in6_addr **addrpp,
                           struct in6_addr *maskp, unsigned int *naddrs)
 {
+       static const struct in6_addr zero_addr;
        struct in6_addr *addrp;
        unsigned int i, j, k, n;
        char buf[256], *p;
@@ -1382,7 +1383,7 @@ void xtables_ip6parse_any(const char *name, struct in6_addr **addrpp,
        memcpy(maskp, addrp, sizeof(*maskp));
 
        /* if a null mask is given, the name is ignored, like in "any/0" */
-       if (memcmp(maskp, &in6addr_any, sizeof(in6addr_any)) == 0)
+       if (memcmp(maskp, &zero_addr, sizeof(zero_addr)) == 0)
                strcpy(buf, "::");
 
        addrp = *addrpp = ip6parse_hostnetwork(buf, naddrs);