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