Browse Source

Attempt to bugfix ipv6 addr defs preprocessors check

Yann Weber 5 years ago
parent
commit
21ceb9dc3b
3 changed files with 6 additions and 25 deletions
  1. 4
    3
      src/SConscript
  2. 0
    12
      src/libiptc/libiptc.h
  3. 2
    10
      src/ntkresolv.c

+ 4
- 3
src/SConscript View File

@@ -107,9 +107,10 @@ if not os.path.exists("config.log") and not env.GetOption('clean'):
107 107
 		print 'Did not find the openssl headers, exiting!'
108 108
 		Execute(Delete('config.log'))
109 109
 		Exit(1)
110
-
111
-	if conf.CheckCHeader(["net/if.h", "netinet/in.h"]):
112
-		env.Append(CCFLAGS = ['-DHAVE_NET_IF_H'])
110
+	if not conf.CheckCHeader(["net/if.h", "netinet/in.h"]):
111
+		print 'Did not find the net/if.h and netinet/in.h headers, exiting!'
112
+		Execute(Delete('config.log'))
113
+		Exit(1)
113 114
 		
114 115
 	env = conf.Finish()
115 116
 

+ 0
- 12
src/libiptc/libiptc.h View File

@@ -7,23 +7,11 @@
7 7
 
8 8
 #include <limits.h>
9 9
 
10
-#ifdef HAVE_NET_IF_H
11 10
 #include <netinet/in.h>
12 11
 #include <netinet/tcp.h>
13 12
 #include <netinet/udp.h>
14 13
 #include <net/if.h>
15 14
 #include <sys/types.h>
16
-#else							/* libc5 */
17
-#include <sys/socket.h>
18
-#include <linux/ip.h>
19
-#include <linux/in.h>
20
-#include <linux/if.h>
21
-#include <linux/icmp.h>
22
-#include <linux/tcp.h>
23
-#include <linux/udp.h>
24
-#include <linux/types.h>
25
-#include <linux/in6.h>
26
-#endif
27 15
 #endif
28 16
 #include <linux/netfilter_ipv4/ip_tables.h>
29 17
 

+ 2
- 10
src/ntkresolv.c View File

@@ -340,11 +340,7 @@ opts_set_question(char *arg)
340 340
 			ntkresolv_safe_exit(1);
341 341
 		}
342 342
 		G_ALIGN(16);
343
-#ifdef HAVE_NET_IF_H
344
-		memcpy(GQT->qstdata, &i6a.__in6_union, 16);
345
-#else
346
-		memcpy(GQT->qstdata, &i6a.__in6_u, 16);
347
-#endif
343
+		memcpy(GQT->qstdata, &i6a.s6_addr16, 16);
348 344
 		GQT->ipv = ANDNS_IPV6;
349 345
 		return;
350 346
 	case QTYPE_G:
@@ -428,11 +424,7 @@ ip_bin_to_str(void *data, char *dst)
428 424
 		via = (void *) (&ia);
429 425
 		break;
430 426
 	case AF_INET6:
431
-#ifdef HAVE_NET_IF_H
432
-		memcpy(&(i6a.__in6_union), data, 16);
433
-#else
434
-		memcpy(&(i6a.__in6_u), data, 16);
435
-#endif
427
+		memcpy(&(i6a.s6_addr16), data, 16);
436 428
 		via = (void *) (&i6a);
437 429
 		break;
438 430
 	default:

Loading…
Cancel
Save