merge of '178eac00dc5aa8338d42e8e203633bec7817bbf6'
[vuplus_openembedded] / packages / iptables / files / iptables-use-s6_addr32.patch
1 This patch fixes a compile error which is demonstrated with glibc/eglibc cvs
2 the union ip6_u has been renamed inside glibc header in.h here
3 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/inet/netinet/in.h.diff?r1=1.55&r2=1.56&cvsroot=glibc
4 We should be really using
5 the defines that are provided in inet/netinet/in.h to access the members instead.
6  
7 Index: iptables-1.3.8/ip6tables.c
8 ===================================================================
9 --- iptables-1.3.8.orig/ip6tables.c
10 +++ iptables-1.3.8/ip6tables.c
11 @@ -730,7 +730,7 @@ parse_hostnetworkmask(const char *name, 
12         for (i = 0, j = 0; i < n; i++) {
13                 int k;
14                 for (k = 0; k < 4; k++)
15 -                       addrp[j].in6_u.u6_addr32[k] &= maskp->in6_u.u6_addr32[k];
16 +                       addrp[j].s6_addr32[k] &= maskp->s6_addr32[k];
17                 j++;
18                 for (k = 0; k < j - 1; k++) {
19                         if (IN6_ARE_ADDR_EQUAL(&addrp[k], &addrp[j - 1])) {
20 Index: iptables-1.3.8/libiptc/libip6tc.c
21 ===================================================================
22 --- iptables-1.3.8.orig/libiptc/libip6tc.c
23 +++ iptables-1.3.8/libiptc/libip6tc.c
24 @@ -113,7 +113,7 @@ typedef unsigned int socklen_t;
25  #include "libiptc.c"
26  
27  #define BIT6(a, l) \
28 - ((ntohl(a->in6_u.u6_addr32[(l) / 32]) >> (31 - ((l) & 31))) & 1)
29 + ((ntohl(a->s6_addr32[(l) / 32]) >> (31 - ((l) & 31))) & 1)
30  
31  int
32  ipv6_prefix_length(const struct in6_addr *a)