Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/dist/ipsec-tools From Rainer Weikusat <rweikusat@mobi...
details: https://anonhg.NetBSD.org/src/rev/638c881ca6f8
branches: trunk
changeset: 772643:638c881ca6f8
user: tteras <tteras%NetBSD.org@localhost>
date: Tue Jan 10 12:07:30 2012 +0000
description:
>From Rainer Weikusat <rweikusat%mobileactivedefense.com@localhost>: Enhance splitnet
environment variable string value generation.
diffstat:
crypto/dist/ipsec-tools/configure.ac | 2 +-
crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diffs (52 lines):
diff -r db6262e306b1 -r 638c881ca6f8 crypto/dist/ipsec-tools/configure.ac
--- a/crypto/dist/ipsec-tools/configure.ac Tue Jan 10 12:07:17 2012 +0000
+++ b/crypto/dist/ipsec-tools/configure.ac Tue Jan 10 12:07:30 2012 +0000
@@ -112,7 +112,7 @@
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h sys/time.h unistd.h stdarg.h varargs.h)
-AC_CHECK_HEADERS(shadow.h)
+AC_CHECK_HEADERS(shadow.h strings.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
diff -r db6262e306b1 -r 638c881ca6f8 crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
--- a/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c Tue Jan 10 12:07:17 2012 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c Tue Jan 10 12:07:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isakmp_unity.c,v 1.10 2012/01/01 17:31:42 tteras Exp $ */
+/* $NetBSD: isakmp_unity.c,v 1.11 2012/01/10 12:07:30 tteras Exp $ */
/* Id: isakmp_unity.c,v 1.10 2006/07/31 04:49:23 manubsd Exp */
@@ -62,6 +62,9 @@
#endif
#include <ctype.h>
#include <resolv.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include "var.h"
#include "misc.h"
@@ -399,16 +402,17 @@
while (netentry != NULL) {
inet_ntop(AF_INET, &netentry->network.addr4, tmp1, 40);
- inet_ntop(AF_INET, &netentry->network.mask4, tmp2, 40);
if (splitnet_ipaddr == CIDR) {
uint32_t tmp3;
int cidrmask;
tmp3 = ntohl(netentry->network.mask4.s_addr);
- for (cidrmask = 0; tmp3 != 0; cidrmask++)
- tmp3 <<= 1;
+ cidrmask = 33 - ffs(tmp3);
+ if (cidrmask == 33) cidrmask = 0;
+
len += sprintf(str+len, "%s/%d ", tmp1, cidrmask);
} else {
+ inet_ntop(AF_INET, &netentry->network.mask4, tmp2, 40);
len += sprintf(str+len, "%s/%s ", tmp1, tmp2);
}
Home |
Main Index |
Thread Index |
Old Index