ipsec-tools: fix compilation against Linux 3.7, refresh patches

git-svn-id: svn://svn.openwrt.org/openwrt/packages@35312 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2013-01-24 11:35:58 +00:00
parent f86e014492
commit 73bb02239f
5 changed files with 70 additions and 21 deletions

View File

@ -19,6 +19,8 @@ PKG_MD5SUM:=b79aae3055a51f8de5c0f1b8ca6cf619
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/ipsec-tools

View File

@ -1,7 +1,6 @@
diff -brau ipsec-tools-0.7.3.o/src/racoon/oakley.c ipsec-tools-0.7.3/src/racoon/oakley.c
--- a/src/racoon/oakley.c 2009-08-13 11:18:45.000000000 +0200
+++ b/src/racoon/oakley.c 2011-06-06 09:36:11.000000000 +0200
@@ -2498,8 +2498,21 @@
--- a/src/racoon/oakley.c
+++ b/src/racoon/oakley.c
@@ -2419,8 +2419,21 @@ oakley_skeyid(iph1)
plog(LLV_ERROR, LOCATION, iph1->remote,
"couldn't find the pskey for %s.\n",
saddrwop2str(iph1->remote));

View File

@ -1,16 +1,15 @@
diff -urN build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0/src/racoon/isakmp_cfg.c build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0a/src/racoon/isakmp_cfg.c
--- a/src/racoon/isakmp_cfg.c 2010-09-21 16:14:17.000000000 +0300
+++ b/src/racoon/isakmp_cfg.c 2011-07-13 11:52:16.000000000 +0300
--- a/src/racoon/isakmp_cfg.c
+++ b/src/racoon/isakmp_cfg.c
@@ -38,7 +38,7 @@
#include <sys/socket.h>
#include <sys/queue.h>
-#include <utmpx.h>
+#include <utmp.h>
#if defined(__APPLE__) && defined(__MACH__)
#include <util.h>
#endif
@@ -1661,7 +1661,8 @@
@@ -1661,7 +1661,8 @@ isakmp_cfg_accounting_system(port, raddr
int inout;
{
int error = 0;
@ -20,15 +19,15 @@ diff -urN build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0/src/racoon/isakmp_cfg
char addr[NI_MAXHOST];
if (usr == NULL || usr[0]=='\0') {
@@ -1670,34 +1671,37 @@
@@ -1670,34 +1671,37 @@ isakmp_cfg_accounting_system(port, raddr
return -1;
}
- memset(&ut, 0, sizeof ut);
- gettimeofday((struct timeval *)&ut.ut_tv, NULL);
- snprintf(ut.ut_id, sizeof ut.ut_id, TERMSPEC, port);
+ sprintf(term, TERMSPEC, port);
switch (inout) {
case ISAKMP_CFG_LOGIN:
- ut.ut_type = USER_PROCESS;
@ -38,34 +37,34 @@ diff -urN build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0/src/racoon/isakmp_cfg
+
+ strncpy(ut.ut_line, term, UT_LINESIZE);
+ ut.ut_line[UT_LINESIZE - 1] = '\0';
GETNAMEINFO_NULL(raddr, addr);
- strncpy(ut.ut_host, addr, sizeof ut.ut_host);
+ strncpy(ut.ut_host, addr, UT_HOSTSIZE);
+ ut.ut_host[UT_HOSTSIZE - 1] = '\0';
+
+ ut.ut_time = time(NULL);
plog(LLV_INFO, LOCATION, NULL,
"Accounting : '%s' logging on '%s' from %s.\n",
- ut.ut_user, ut.ut_id, addr);
-
- pututxline(&ut);
+ ut.ut_name, ut.ut_line, ut.ut_host);
+ login(&ut);
+
break;
case ISAKMP_CFG_LOGOUT:
- ut.ut_type = DEAD_PROCESS;
plog(LLV_INFO, LOCATION, NULL,
"Accounting : '%s' unlogging from '%s'.\n",
- usr, ut.ut_id);
-
- pututxline(&ut);
+ usr, term);
+ logout(term);
+
break;

View File

@ -1,7 +1,6 @@
diff -urN build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0/src/racoon/ipsec_doi.c build_dir/linux-ar71xx_generic/ipsec-tools-0.8.0a/src/racoon/ipsec_doi.c
--- a/src/racoon/ipsec_doi.c 2010-12-14 19:57:31.000000000 +0200
+++ b/src/racoon/ipsec_doi.c 2011-07-13 12:07:44.000000000 +0300
@@ -3582,8 +3582,8 @@
--- a/src/racoon/ipsec_doi.c
+++ b/src/racoon/ipsec_doi.c
@@ -3582,8 +3582,8 @@ ipsecdoi_checkid1(iph1)
iph1->approval->authmethod == OAKLEY_ATTR_AUTH_METHOD_PSKEY) {
if (id_b->type != IPSECDOI_ID_IPV4_ADDR
&& id_b->type != IPSECDOI_ID_IPV6_ADDR) {

View File

@ -0,0 +1,50 @@
--- a/configure.ac
+++ b/configure.ac
@@ -75,9 +75,10 @@ case "$host_os" in
[ KERNEL_INCLUDE="/lib/modules/`uname -r`/build/include" ])
AC_CHECK_HEADER($KERNEL_INCLUDE/linux/pfkeyv2.h, ,
- [ AC_CHECK_HEADER(/usr/src/linux/include/linux/pfkeyv2.h,
- KERNEL_INCLUDE=/usr/src/linux/include ,
- [ AC_MSG_ERROR([Unable to find linux-2.6 kernel headers. Aborting.]) ] ) ] )
+ [ AC_CHECK_HEADER($KERNEL_INCLUDE/uapi/linux/pfkeyv2.h, ,
+ [ AC_CHECK_HEADER(/usr/src/linux/include/linux/pfkeyv2.h,
+ KERNEL_INCLUDE=/usr/src/linux/include ,
+ [ AC_MSG_ERROR([Unable to find linux-2.6 kernel headers. Aborting.]) ] ) ] ) ] )
AC_SUBST(KERNEL_INCLUDE)
# We need the configure script to run with correct kernel headers.
# However we don't want to point to kernel source tree in compile time,
@@ -644,7 +645,14 @@ AC_EGREP_CPP(yes,
#ifdef SADB_X_EXT_NAT_T_TYPE
yes
#endif
-], [kernel_natt="yes"])
+], [kernel_natt="yes"], [
+ AC_EGREP_CPP(yes,
+ [#include <uapi/linux/pfkeyv2.h>
+ #ifdef SADB_X_EXT_NAT_T_TYPE
+ yes
+ #endif
+ ], [kernel_natt="yes"])
+])
;;
freebsd*|netbsd*)
# NetBSD case
--- a/src/include-glibc/Makefile.am
+++ b/src/include-glibc/Makefile.am
@@ -1,14 +1,7 @@
-
-.includes: ${top_builddir}/config.status
- ln -sf $(KERNEL_INCLUDE)/linux
- touch .includes
-
-all: .includes
-
EXTRA_DIST = \
glibc-bugs.h \
net/pfkeyv2.h \
netinet/ipsec.h \
sys/queue.h
-DISTCLEANFILES = .includes linux
+DISTCLEANFILES = linux