? port-ike-2-1-6.diff
? security/ike/work
Index: security/ike/Makefile
===================================================================
RCS file: /home/ncvs/ports/security/ike/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- security/ike/Makefile	28 Mar 2010 06:43:21 -0000	1.11
+++ security/ike/Makefile	21 Aug 2010 20:53:50 -0000
@@ -6,8 +6,8 @@
 #
 
 PORTNAME=	ike
-PORTVERSION=	2.1.4
-PORTREVISION=	2
+PORTVERSION=	2.1.6
+PORTREVISION=	1
 CATEGORIES=	security net
 MASTER_SITES=	http://www.shrew.net/download/ike/
 DISTNAME=	${PORTNAME}-${PORTVERSION}-release
@@ -18,6 +18,7 @@
 
 ONLY_FOR_ARCHS=	i386 amd64
 
+USE_RC_SUBR=    iked
 USE_BISON=	build
 USE_OPENSSL=	yes
 USE_CMAKE=	yes
@@ -55,25 +56,23 @@
 .endif
 
 post-patch:
-.ifdef(WITH_NATT)
+.if defined(WITH_NATT)
+. if ${OSVERSION} < 800000
 	@${ECHO_MSG} "===> -------------------------------------------------------------------------"
-	@${ECHO_MSG} "===> ATTENTION: You need a kernel patch to enable NAT-Traversal functionality!"
-. if ${OSVERSION} < 600000
-	@${ECHO_MSG} "===>     There is no known NAT-T patch for FreeBSD 1 - 5!!!"
-. endif
-. if ${OSVERSION} > 600000 && ${OSVERSION} < 699999
-	@${ECHO_MSG} "===>     http://ipsec-tools.sf.net/freebsd6-natt.diff"
-. endif
-. if ${OSVERSION} > 700000 && ${OSVERSION} < 799999
-	@${ECHO_MSG} "===>     http://vanhu.free.fr/FreeBSD/patch-natt-freebsd7-2007-10-22.diff"
-. endif
-. if ${OSVERSION} > 800000
-	@${ECHO_MSG} "===>     http://vanhu.free.fr/FreeBSD/patch-natt-freebsd-HEAD-2007-10-22.diff"
-. endif
-	@${ECHO_MSG} "===> You might possibly have to do some steps manually if it fails to apply."
+	@${ECHO_MSG} "===> WARNING: You will need to patch your kernel for NAT-T functionality!"
+.  if ${OSVERSION} < 600000
+	@${ECHO_MSG} "===>   There is no known NAT-T patch for FreeBSD 1 - 5!!!"
+.  endif
+.  if ${OSVERSION} > 600000 && ${OSVERSION} < 699999
+	@${ECHO_MSG} "===>   http://ipsec-tools.sf.net/freebsd6-natt.diff"
+.  endif
+.  if ${OSVERSION} > 700000 && ${OSVERSION} < 799999
+	@${ECHO_MSG} "===>   http://people.freebsd.org/~vanhu/NAT-T/patch-natt-7.2-2009-05-12.diff"
+.  endif
+	@${ECHO_MSG} "===> You may need to edit the patch if it fails to apply cleanly."
 	@${ECHO_MSG} "===> -------------------------------------------------------------------------"
-
 	@sleep 3
+. endif
 .endif
 
 post-build:
@@ -86,8 +85,19 @@
 
 post-install:
 	@if ! ${SYSCTL} -a | ${GREP} -q ipsec; then \
-	${ECHO_MSG} "WARNING: IPsec feature is disabled on this host"; \
-	${ECHO_MSG} "         You must configure a kernel with this option to use this software"; \
+	${ECHO_MSG} "===> -------------------------------------------------------------------------"; \
+	${ECHO_MSG} "===>   You need IPsec support in your kernel, please see:"; \
+	${ECHO_MSG} "===> "; \
+	${ECHO_MSG} "===>   http://www.freebsd.org/doc/en/books/handbook/ipsec.html"; \
+	${ECHO_MSG} "===> -------------------------------------------------------------------------"; \
 	fi ;
+.if defined(WITH_NATT)
+	@${ECHO_MSG} "===> -------------------------------------------------------------------------"
+	@${ECHO_MSG} "===> To use NAT Traversal ( NAT-T ) support, please make sure you include"
+	@${ECHO_MSG} "===> the following line in your kernel config file."
+	@${ECHO_MSG} "===> "
+	@${ECHO_MSG} "===> options IPSEC_NAT_T"
+	@${ECHO_MSG} "===> -------------------------------------------------------------------------"
+.endif
 
 .include <bsd.port.post.mk>
Index: security/ike/distinfo
===================================================================
RCS file: /home/ncvs/ports/security/ike/distinfo,v
retrieving revision 1.5
diff -u -r1.5 distinfo
--- security/ike/distinfo	23 Jul 2009 14:37:53 -0000	1.5
+++ security/ike/distinfo	21 Aug 2010 20:53:50 -0000
@@ -1,3 +1,3 @@
-MD5 (ike-2.1.4-release.tbz2) = 1b855717698ba62781284b202aa72a98
-SHA256 (ike-2.1.4-release.tbz2) = 8c587e71af361ecb383c99dea0ae01b45f6206a23de8d113c75e996729dc5677
-SIZE (ike-2.1.4-release.tbz2) = 575785
+MD5 (ike-2.1.6-release.tbz2) = 60b9549bac392dc5546927f041c4f5ff
+SHA256 (ike-2.1.6-release.tbz2) = 3f32acf46234150693f4e4f353a57d6aa1c38a21435a2a7994347017f8771981
+SIZE (ike-2.1.6-release.tbz2) = 581191
Index: security/ike/pkg-plist
===================================================================
RCS file: /home/ncvs/ports/security/ike/pkg-plist,v
retrieving revision 1.5
diff -u -r1.5 pkg-plist
--- security/ike/pkg-plist	23 Jul 2009 14:37:53 -0000	1.5
+++ security/ike/pkg-plist	21 Aug 2010 20:53:50 -0000
@@ -5,6 +5,6 @@
 bin/ikea
 bin/ikec
 lib/libike.so
-lib/libike.so.2.1.4
+lib/libike.so.2.1.6
 lib/libpfk.so
-lib/libpfk.so.2.1.4
+lib/libpfk.so.2.1.6
Index: security/ike/files/iked.in
===================================================================
RCS file: security/ike/files/iked.in
diff -N security/ike/files/iked.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ security/ike/files/iked.in	21 Aug 2010 20:53:50 -0000
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# rc.d script for iked
+#
+# $Id$
+
+# PROVIDE: iked
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable iked:
+#
+#  #required
+#  iked_enable="YES"
+#
+
+. "/etc/rc.subr"
+
+# defaults
+iked_enable=${iked_enable:-"NO"}
+
+name=iked
+rcvar=`set_rcvar`
+load_rc_config $name
+command=/usr/local/sbin/iked
+command_args="-p /var/run/iked.pid"
+
+run_rc_command "$1"
Index: security/ike/files/patch-source_iked_conf.parse.yy
===================================================================
RCS file: security/ike/files/patch-source_iked_conf.parse.yy
diff -N security/ike/files/patch-source_iked_conf.parse.yy
--- security/ike/files/patch-source_iked_conf.parse.yy	6 Mar 2009 12:04:10 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
---- source/iked/conf.parse.yy.orig	2008-06-10 04:24:20.000000000 +0200
-+++ source/iked/conf.parse.yy	2009-03-06 11:40:56.000000000 +0100
-@@ -43,7 +43,7 @@
- %defines
- %define "parser_class_name" "conf_parser"
- 
--%{
-+%code requires {
- 
- #include <string>
- 
-@@ -51,7 +51,7 @@
- 
- typedef class _IKED IKED;
- 
--%}
-+}
- 
- // The parsing context.
- %parse-param { IKED & iked }
Index: security/ike/files/patch-source_iked_phase2_cpp.diff
===================================================================
RCS file: security/ike/files/patch-source_iked_phase2_cpp.diff
diff -N security/ike/files/patch-source_iked_phase2_cpp.diff
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ security/ike/files/patch-source_iked_phase2_cpp.diff	21 Aug 2010 20:53:50 -0000
@@ -0,0 +1,48 @@
+Index: source/iked/ike.exch.phase2.cpp
+===================================================================
+--- source/iked/ike.exch.phase2.cpp	(revision 722)
++++ source/iked/ike.exch.phase2.cpp	(working copy)
+@@ -1373,7 +1373,21 @@
+ 		IDB_POLICY * policy_in;
+ 		IDB_POLICY * policy_out;
+ 
++		IKE_PH2ID * ph2id_rs = &ph2->ph2id_rs;
++		IKE_PH2ID * ph2id_rd = &ph2->ph2id_rd;
++
+ 		//
++		// if we are using the shared policy
++		// level, we match the first policies
++		// for the peer using the destination
++		// id value only. The source id value
++		// is irrelevant as it is generic.
++		//
++
++		if( ph2->tunnel->peer->plcy_level == POLICY_LEVEL_SHARED )
++			ph2id_rs = NULL;
++
++		//
+ 		// locate inbound ipsec policy
+ 		//
+ 
+@@ -1386,8 +1400,8 @@
+ 				NULL,
+ 				&ph2->tunnel->saddr_r,
+ 				&ph2->tunnel->saddr_l,
+-				&ph2->ph2id_rs,
+-				&ph2->ph2id_rd ) )
++				ph2id_rs,
++				ph2id_rd ) )
+ 		{
+ 			log.txt( LLOG_ERROR, 
+ 				"ii : phase2 rejected, no matching inbound policy found\n"
+@@ -1417,8 +1431,8 @@
+ 				NULL,
+ 				&ph2->tunnel->saddr_l,
+ 				&ph2->tunnel->saddr_r,
+-				&ph2->ph2id_rd,
+-				&ph2->ph2id_rs ) )
++				ph2id_rd,
++				ph2id_rs ) )
+ 		{
+ 			log.txt( LLOG_ERROR, 
+ 				"ii : phase2 rejected, no matching outbound policy found\n"
