Parcourir la source

Merge pull request #1436 from ManoftheSea/musl-compat

Make ipsec-tools compatible with musl
Noah Meyerhans il y a 9 ans
Parent
révision
0b73e6833b
2 fichiers modifiés avec 188 ajouts et 1 suppressions
  1. 1
    1
      net/ipsec-tools/Makefile
  2. 187
    0
      net/ipsec-tools/patches/009-musl-compat.patch

+ 1
- 1
net/ipsec-tools/Makefile Voir le fichier

@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
11 11
 
12 12
 PKG_NAME:=ipsec-tools
13 13
 PKG_VERSION:=0.8.2
14
-PKG_RELEASE:=3
14
+PKG_RELEASE:=4
15 15
 PKG_MAINTAINER := "Noah Meyerhans <frodo@morgul.net>"
16 16
 PKG_LICENSE := BSD-3-Clause
17 17
 

+ 187
- 0
net/ipsec-tools/patches/009-musl-compat.patch Voir le fichier

@@ -0,0 +1,187 @@
1
+--- a/src/racoon/grabmyaddr.c
2
++++ b/src/racoon/grabmyaddr.c
3
+@@ -47,7 +47,6 @@
4
+ #include <net/route.h>
5
+ #include <net/if.h>
6
+ #include <net/if_dl.h>
7
+-#include <sys/sysctl.h>
8
+ #define USE_ROUTE
9
+ #endif
10
+ 
11
+--- a/src/racoon/pfkey.c
12
++++ b/src/racoon/pfkey.c
13
+@@ -59,7 +59,6 @@
14
+ #include <sys/param.h>
15
+ #include <sys/socket.h>
16
+ #include <sys/queue.h>
17
+-#include <sys/sysctl.h>
18
+ 
19
+ #include <net/route.h>
20
+ #include <net/pfkeyv2.h>
21
+--- a/src/setkey/setkey.c
22
++++ b/src/setkey/setkey.c
23
+@@ -40,7 +40,6 @@
24
+ #include <sys/socket.h>
25
+ #include <sys/time.h>
26
+ #include <sys/stat.h>
27
+-#include <sys/sysctl.h>
28
+ #include <err.h>
29
+ #include <netinet/in.h>
30
+ #include <net/pfkeyv2.h>
31
+--- a/src/libipsec/ipsec_strerror.h
32
++++ b/src/libipsec/ipsec_strerror.h
33
+@@ -34,6 +34,8 @@
34
+ #ifndef _IPSEC_STRERROR_H
35
+ #define _IPSEC_STRERROR_H
36
+ 
37
++#include <sys/cdefs.h>
38
++
39
+ extern int __ipsec_errcode;
40
+ extern void __ipsec_set_strerror __P((const char *));
41
+ 
42
+--- a/src/libipsec/libpfkey.h
43
++++ b/src/libipsec/libpfkey.h
44
+@@ -34,6 +34,8 @@
45
+ #ifndef _LIBPFKEY_H
46
+ #define _LIBPFKEY_H
47
+ 
48
++#include <sys/cdefs.h>
49
++
50
+ #ifndef KAME_LIBPFKEY_H
51
+ #define KAME_LIBPFKEY_H
52
+ 
53
+--- a/src/racoon/backupsa.c
54
++++ b/src/racoon/backupsa.c
55
+@@ -276,9 +276,9 @@ do { 								\
56
+ 		GETNEXTNUM(sa_args.a_keylen, strtoul);
57
+ 		GETNEXTNUM(sa_args.flags, strtoul);
58
+ 		GETNEXTNUM(sa_args.l_alloc, strtoul);
59
+-		GETNEXTNUM(sa_args.l_bytes, strtouq);
60
+-		GETNEXTNUM(sa_args.l_addtime, strtouq);
61
+-		GETNEXTNUM(sa_args.l_usetime, strtouq);
62
++		GETNEXTNUM(sa_args.l_bytes, strtoull);
63
++		GETNEXTNUM(sa_args.l_addtime, strtoull);
64
++		GETNEXTNUM(sa_args.l_usetime, strtoull);
65
+ 		GETNEXTNUM(sa_args.seq, strtoul);
66
+ 
67
+ #undef GETNEXTNUM
68
+--- a/src/racoon/cftoken.l
69
++++ b/src/racoon/cftoken.l
70
+@@ -77,6 +77,10 @@
71
+ 
72
+ #include "cfparse.h"
73
+ 
74
++#ifndef GLOB_TILDE
75
++#define GLOB_TILDE 0
76
++#endif
77
++
78
+ int yyerrorcount = 0;
79
+ 
80
+ #if defined(YIPS_DEBUG)
81
+--- a/src/racoon/logger.h
82
++++ b/src/racoon/logger.h
83
+@@ -34,6 +34,8 @@
84
+ #ifndef _LOGGER_H
85
+ #define _LOGGER_H
86
+ 
87
++#include <sys/cdefs.h>
88
++
89
+ struct log {
90
+ 	int head;
91
+ 	int siz;
92
+--- a/src/racoon/misc.h
93
++++ b/src/racoon/misc.h
94
+@@ -34,6 +34,8 @@
95
+ #ifndef _MISC_H
96
+ #define _MISC_H
97
+ 
98
++#include <sys/cdefs.h>
99
++
100
+ #define BIT2STR(b) bit2str(b, sizeof(b)<<3)
101
+ 
102
+ #ifdef HAVE_FUNC_MACRO
103
+--- a/src/racoon/missing/crypto/sha2/sha2.h
104
++++ b/src/racoon/missing/crypto/sha2/sha2.h
105
+@@ -40,6 +40,8 @@
106
+ #ifndef __SHA2_H__
107
+ #define __SHA2_H__
108
+ 
109
++#include <sys/cdefs.h>
110
++
111
+ #ifdef __cplusplus
112
+ extern "C" {
113
+ #endif
114
+--- a/src/racoon/netdb_dnssec.h
115
++++ b/src/racoon/netdb_dnssec.h
116
+@@ -34,6 +34,8 @@
117
+ #ifndef _NETDB_DNSSEC_H
118
+ #define _NETDB_DNSSEC_H
119
+ 
120
++#include <sys/cdefs.h>
121
++
122
+ #ifndef T_CERT
123
+ #define T_CERT	37		/* defined by RFC2538 section 2 */
124
+ #endif
125
+--- a/src/racoon/plog.h
126
++++ b/src/racoon/plog.h
127
+@@ -34,6 +34,8 @@
128
+ #ifndef _PLOG_H
129
+ #define _PLOG_H
130
+ 
131
++#include <sys/cdefs.h>
132
++
133
+ #ifdef HAVE_STDARG_H
134
+ #include <stdarg.h>
135
+ #else
136
+--- a/src/racoon/str2val.h
137
++++ b/src/racoon/str2val.h
138
+@@ -34,6 +34,8 @@
139
+ #ifndef _STR2VAL_H
140
+ #define _STR2VAL_H
141
+ 
142
++#include <sys/cdefs.h>
143
++
144
+ extern caddr_t val2str __P((const char *, size_t));
145
+ extern char *str2val __P((const char *, int, size_t *));
146
+ 
147
+--- a/src/racoon/vmbuf.h
148
++++ b/src/racoon/vmbuf.h
149
+@@ -34,6 +34,8 @@
150
+ #ifndef _VMBUF_H
151
+ #define _VMBUF_H
152
+ 
153
++#include <sys/cdefs.h>
154
++
155
+ /*
156
+  *	bp      v
157
+  *	v       v
158
+--- a/src/setkey/extern.h
159
++++ b/src/setkey/extern.h
160
+@@ -1,6 +1,6 @@
161
+ /*	$NetBSD: extern.h,v 1.5 2009/03/06 11:45:03 tteras Exp $	*/
162
+ 
163
+-
164
++#include <sys/cdefs.h>
165
+ 
166
+ void parse_init __P((void));
167
+ int parse __P((FILE **));
168
+--- a/src/racoon/isakmp_cfg.c
169
++++ b/src/racoon/isakmp_cfg.c
170
+@@ -1694,8 +1694,6 @@ isakmp_cfg_accounting_system(port, raddr
171
+ 			"Accounting : '%s' logging on '%s' from %s.\n",
172
+ 			ut.ut_name, ut.ut_line, ut.ut_host);
173
+ 
174
+-		login(&ut);
175
+-		
176
+ 		break;
177
+ 	case ISAKMP_CFG_LOGOUT:	
178
+ 
179
+@@ -1703,8 +1701,6 @@ isakmp_cfg_accounting_system(port, raddr
180
+ 			"Accounting : '%s' unlogging from '%s'.\n",
181
+ 			usr, term);
182
+ 
183
+-		logout(term);
184
+-		
185
+ 		break;
186
+ 	default:
187
+ 		plog(LLV_ERROR, LOCATION, NULL, "Unepected inout\n");