bugzilla-daemon@netfilter.org
2003-Jun-21 15:31 UTC
[Bug 102] New: ipv6_prefix_length works only on LITTLE_ENDIAN and prefix_length % 8 == 0
https://bugzilla.netfilter.org/cgi-bin/bugzilla/show_bug.cgi?id=102 Summary: ipv6_prefix_length works only on LITTLE_ENDIAN and prefix_length % 8 == 0 Product: iptables userspace Version: 1.2.8 Platform: other OS/Version: All Status: NEW Severity: minor Priority: P2 Component: libiptc AssignedTo: laforge@netfilter.org ReportedBy: mikko.markus.torni@iki.fi CC: netfilter-buglog@lists.netfilter.org ipv6_prefix_length in libiptc/libip6tc.c works only in these cases: architecture is LITTLE_ENDIAN and given prefix is a multiple of 8 architecture is BIG_ENDIAN and given prefix is a multiple of 32 Here's one way to fix the problem: --- iptables-1.2.8/libiptc/libip6tc.c 2002-02-14 01:13:23.000000000 +0200 +++ iptables-1.2.8-new/libiptc/libip6tc.c 2003-06-21 18:16:35.000000000 +0300 @@ -110,7 +110,7 @@ #include "libiptc.c" #define BIT6(a, l) \ - (((a->in6_u.u6_addr32[(l) / 32]) >> ((l) & 31)) & 1) + ((ntohl(a->in6_u.u6_addr32[(l) / 32]) >> (31 - ((l) & 31))) & 1) int ipv6_prefix_length(const struct in6_addr *a) ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
Possibly Parallel Threads
- [ANNOUNCE] Release of iptables-1.2.9
- [ANNOUNCE] Release of iptables-1.2.9rc1
- [Bug 1289] New: iptables build fails with kernel 4.20-rc1 - gnu_inline attributes
- [Bug 826] New: libiptc/libip6tc.h doesn't specify C linkage
- [Bug 1291] New: iptables 1.8.0+ no longer builds against kernel 3.10.108