瀏覽代碼

Alpine linux musl libc bugfixes

Yann Weber 6 年之前
父節點
當前提交
dd43556d0b
共有 7 個文件被更改,包括 23 次插入7 次删除
  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 查看文件

@@ -58,9 +58,13 @@ For Archlinux, Try this.
58 58
 
59 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 69
 To compile the code you can do this:
66 70
    

+ 1
- 1
SConstruct 查看文件

@@ -22,7 +22,7 @@ opts.AddVariables(('CONF_DIR', """Directory where the Netsukuku configuration fi
22 22
 opts.Add('CC', 'The C compiler.')
23 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 27
 env['platform'] = _platform.system().lower();
28 28
 env["CC"] = os.getenv("CC") or env["CC"]

+ 3
- 0
src/SConscript 查看文件

@@ -107,6 +107,9 @@ 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 113
 		
111 114
 	env = conf.Finish()
112 115
 

+ 1
- 1
src/libiptc/libiptc.h 查看文件

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

+ 3
- 3
src/netsplit.c 查看文件

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

+ 8
- 0
src/ntkresolv.c 查看文件

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

+ 1
- 0
src/xmalloc.c 查看文件

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

Loading…
取消
儲存