[Bug 103] New: ip6tables -L does not separate address and mask if mask is odd

bugzilla-daemon@netfilter.org bugzilla-daemon@netfilter.org
Sat, 21 Jun 2003 17:43:03 +0200


https://bugzilla.netfilter.org/cgi-bin/bugzilla/show_bug.cgi?id=103

           Summary: ip6tables -L does not separate address and mask if mask
                    is odd
           Product: iptables userspace
           Version: 1.2.8
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: ip6tables
        AssignedTo: laforge@netfilter.org
        ReportedBy: mikko.markus.torni@iki.fi
                CC: netfilter-buglog@lists.netfilter.org


ip6tables -L does not separate address and mask if mask is odd

Example output:

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DROP       all      ffc0::ffc0::         anywhere

Here's a patch that fixes it:

--- iptables-1.2.8/ip6tables.c  2003-06-21 18:19:30.000000000 +0300
+++ iptables-1.2.8-new/ip6tables.c      2003-06-21 18:37:42.000000000 +0300
@@ -578,10 +578,13 @@
 static char *
 mask_to_numeric(const struct in6_addr *addrp)
 {
-       static char buf[20];
+       static char buf[50+2];
        int l = ipv6_prefix_length(addrp);
-       if (l == -1)
-               return addr_to_numeric(addrp);
+       if (l == -1) {
+               strcpy(buf, "/");
+               strcat(buf, addr_to_numeric(addrp));
+               return buf;
+       }
        sprintf(buf, "/%d", l);
        return buf;
 }



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.