Browse Source

Alpine linux musl libc bugfixes

Yann Weber 5 years ago
parent
commit
dd43556d0b
7 changed files with 23 additions and 7 deletions
  1. 6
    2
      README.md
  2. 1
    1
      SConstruct
  3. 3
    0
      src/SConscript
  4. 1
    1
      src/libiptc/libiptc.h
  5. 3
    3
      src/netsplit.c
  6. 8
    0
      src/ntkresolv.c
  7. 1
    0
      src/xmalloc.c

+ 6
- 2
README.md View File

58
 
58
 
59
     sudo pacman -S zlib gmp lib32-gmp openssl lib32-openssl libgee pth libgcrypt autoconf cmake autogen gawk scons git
59
     sudo pacman -S zlib gmp lib32-gmp openssl lib32-openssl libgee pth libgcrypt autoconf cmake autogen gawk scons git
60
 
60
 
61
-For AlpineLinux Try this.
61
+For AlpineLinux, Try this.
62
 
62
 
63
-    apk add scons libssl1.0 openssl libgee gmp gmp-dev libgcrypt gawk zlib zlib-dev gcc pkgconf pkgconfig libc-dev libressl-dev libexecinfo-dev linux-headers
63
+    apk add scons libssl1.0 openssl libgee gmp gmp-dev libgcrypt gawk zlib zlib-dev gcc pkgconf pkgconfig libc-dev libressl-dev libexecinfo-dev linux-headers python
64
+
65
+For Debian, Try this.
66
+
67
+    apt-get install build-essential scons libgcrypt20-dev libssl1.0-dev libgmp-dev zlib1g-dev
64
 
68
 
65
 To compile the code you can do this:
69
 To compile the code you can do this:
66
    
70
    

+ 1
- 1
SConstruct View File

22
 opts.Add('CC', 'The C compiler.')
22
 opts.Add('CC', 'The C compiler.')
23
 opts.Add('CXX', 'The C++ compiler.')
23
 opts.Add('CXX', 'The C++ compiler.')
24
 
24
 
25
-env = Environment(options = opts, ENV = os.environ, CCFLAGS = ' -Wall')
25
+env = Environment(options = opts, ENV = os.environ, CCFLAGS = ['-Wall', '-ggdb'])
26
 
26
 
27
 env['platform'] = _platform.system().lower();
27
 env['platform'] = _platform.system().lower();
28
 env["CC"] = os.getenv("CC") or env["CC"]
28
 env["CC"] = os.getenv("CC") or env["CC"]

+ 3
- 0
src/SConscript View File

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

+ 1
- 1
src/libiptc/libiptc.h View File

7
 
7
 
8
 #include <limits.h>
8
 #include <limits.h>
9
 
9
 
10
-#if defined(__GLIBC__) && __GLIBC__ == 2
10
+#ifdef HAVE_NET_IF_H
11
 #include <netinet/in.h>
11
 #include <netinet/in.h>
12
 #include <netinet/tcp.h>
12
 #include <netinet/tcp.h>
13
 #include <netinet/udp.h>
13
 #include <netinet/udp.h>

+ 3
- 3
src/netsplit.c View File

77
 
77
 
78
   char *ret;
78
   char *ret;
79
   char *ret1;
79
   char *ret1;
80
-  char new_domain[MAXNAMLEN];
80
+  char new_domain[NAME_MAX];
81
   int rt_value;
81
   int rt_value;
82
 
82
 
83
   strcpy (new_domain, domain);
83
   strcpy (new_domain, domain);
141
 
141
 
142
   char *ret;
142
   char *ret;
143
   char *ret1;
143
   char *ret1;
144
-  char new_domain[MAXNAMLEN];
144
+  char new_domain[NAME_MAX];
145
   int rt_value;
145
   int rt_value;
146
 
146
 
147
   strcpy (new_domain, domain);
147
   strcpy (new_domain, domain);
197
 domain_ip_processing (char *domain)
197
 domain_ip_processing (char *domain)
198
 {
198
 {
199
   char *ret;
199
   char *ret;
200
-  char new_domain[MAXNAMLEN];
200
+  char new_domain[NAME_MAX];
201
   int rt_value;
201
   int rt_value;
202
   int i;
202
   int i;
203
   ret = strstr (domain, ".inet");
203
   ret = strstr (domain, ".inet");

+ 8
- 0
src/ntkresolv.c View File

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

+ 1
- 0
src/xmalloc.c View File

33
  * xzalloc(size_t size) added.
33
  * xzalloc(size_t size) added.
34
 \*/
34
 \*/
35
 
35
 
36
+#include <sys/types.h>
36
 #include <stdlib.h>
37
 #include <stdlib.h>
37
 #include <string.h>
38
 #include <string.h>
38
 
39
 

Loading…
Cancel
Save