PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
include $(INCLUDE_DIR)/package.mk
define Package/ipsec-tools
-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));
-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;
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;
+
+ 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;
-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) {
--- /dev/null
+--- 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