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

@ -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;