DragonFly BSD
DragonFly submit List (threaded) for 2006-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

ipsec-tools patch


From: Gary Allan <dragonfly@xxxxxxxxxxxxxxx>
Date: Fri, 28 Apr 2006 14:16:30 +0100


The ipsec-tools port included in pkgsrc does not compile on DragonFly. The included program racoon is useful for setting up IPsec between PCs/Firewalls. The attached patch alows building under DragonFly.

I have tested the raccon daemon negotiating with WinXP. Is it worth submitting this upstream and/or to pkgsrc?


Build ipsec-tools (http://ipsec-tools.sourceforge.net) and install into /usr/pkg. Configuration files will be stored under /usr/pkg/etc/racoon.

tar xfvj ipsec-tools-0.6.5.tar.bz2
cd ipsec-tools-0.6.5
patch -p1 < ~/ipsec-tools-0.6.5.diff
. /configure --prefix=/usr/pkg --sysconfdir=/usr/pkg/etc/racoon
make
make install


Regards


Gary

diff -ru ipsec-tools-0.6.5.orig/configure ipsec-tools-0.6.5/configure
--- ipsec-tools-0.6.5.orig/configure	2006-04-28 09:36:25.000000000 +0100
+++ ipsec-tools-0.6.5/configure	2006-04-28 13:48:34.000000000 +0100
@@ -24212,7 +24212,14 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-		#include <openssl/sha.h>
+#include <openssl/opensslv.h>
+
+/* OpenSSL 0.9.8 headers require size_t to be defined */
+#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
+#include <sys/types.h>
+#endif
+
+#include <openssl/sha.h>
 
 int
 main ()
diff -ru ipsec-tools-0.6.5.orig/src/libipsec/key_debug.c ipsec-tools-0.6.5/src/libipsec/key_debug.c
--- ipsec-tools-0.6.5.orig/src/libipsec/key_debug.c	2006-04-28 09:36:24.000000000 +0100
+++ ipsec-tools-0.6.5/src/libipsec/key_debug.c	2006-04-28 13:38:27.000000000 +0100
@@ -34,7 +34,7 @@
 #endif
 
 #ifdef _KERNEL
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__DragonFly__)
 #include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
@@ -707,7 +707,7 @@
 		    m->m_pkthdr.len, m->m_pkthdr.rcvif);
 	}
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 	if (m->m_flags & M_EXT) {
 		printf("  m_ext{ ext_buf:%p ext_free:%p "
 		       "ext_size:%u ext_ref:%p }\n",
diff -ru ipsec-tools-0.6.5.orig/src/libipsec/policy_token.c ipsec-tools-0.6.5/src/libipsec/policy_token.c
--- ipsec-tools-0.6.5.orig/src/libipsec/policy_token.c	2006-04-28 09:36:24.000000000 +0100
+++ ipsec-tools-0.6.5/src/libipsec/policy_token.c	2006-04-28 13:38:27.000000000 +0100
@@ -530,7 +530,7 @@
 
 #include "libpfkey.h"
 
-#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__linux__)
+#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__linux__)
 #include "y.tab.h"
 #else
 #include "policy_parse.h"
diff -ru ipsec-tools-0.6.5.orig/src/libipsec/policy_token.l ipsec-tools-0.6.5/src/libipsec/policy_token.l
--- ipsec-tools-0.6.5.orig/src/libipsec/policy_token.l	2006-04-28 09:36:24.000000000 +0100
+++ ipsec-tools-0.6.5/src/libipsec/policy_token.l	2006-04-28 13:38:27.000000000 +0100
@@ -53,7 +53,7 @@
 
 #include "libpfkey.h"
 
-#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__linux__)
+#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__linux__)
 #include "y.tab.h"
 #else
 #include "policy_parse.h"
diff -ru ipsec-tools-0.6.5.orig/src/racoon/crypto_openssl.c ipsec-tools-0.6.5/src/racoon/crypto_openssl.c
--- ipsec-tools-0.6.5.orig/src/racoon/crypto_openssl.c	2006-04-28 09:36:22.000000000 +0100
+++ ipsec-tools-0.6.5/src/racoon/crypto_openssl.c	2006-04-28 13:46:29.000000000 +0100
@@ -46,6 +46,11 @@
 #error OpenSSL version 0.9.6 or later required.
 #endif
 
+/* OpenSSL 0.9.8 headers require size_t to be defined */
+#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090800fL)
+#include <sys/types.h>
+#endif
+
 #include <openssl/pem.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
diff -ru ipsec-tools-0.6.5.orig/src/racoon/grabmyaddr.c ipsec-tools-0.6.5/src/racoon/grabmyaddr.c
--- ipsec-tools-0.6.5.orig/src/racoon/grabmyaddr.c	2006-04-28 09:36:22.000000000 +0100
+++ ipsec-tools-0.6.5/src/racoon/grabmyaddr.c	2006-04-28 13:38:27.000000000 +0100
@@ -37,10 +37,10 @@
 #include <sys/ioctl.h>
 
 #include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__DragonFly__)
 #include <net/if_var.h>
 #endif
-#if defined(__NetBSD__) || defined(__FreeBSD__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #include <netinet/in.h>
 #include <netinet6/in6_var.h>
 #endif
diff -ru ipsec-tools-0.6.5.orig/src/racoon/gssapi.h ipsec-tools-0.6.5/src/racoon/gssapi.h
--- ipsec-tools-0.6.5.orig/src/racoon/gssapi.h	2006-04-28 09:36:21.000000000 +0100
+++ ipsec-tools-0.6.5/src/racoon/gssapi.h	2006-04-28 13:38:27.000000000 +0100
@@ -32,7 +32,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 #include "/usr/include/gssapi.h"
 #else
 #include <gssapi/gssapi.h>
diff -ru ipsec-tools-0.6.5.orig/src/racoon/isakmp.c ipsec-tools-0.6.5/src/racoon/isakmp.c
--- ipsec-tools-0.6.5.orig/src/racoon/isakmp.c	2006-04-28 09:36:22.000000000 +0100
+++ ipsec-tools-0.6.5/src/racoon/isakmp.c	2006-04-28 13:38:27.000000000 +0100
@@ -114,11 +114,11 @@
 #   define SOL_UDP 17
 #  endif
 # endif /* __linux__ */
-# if defined(__NetBSD__) || defined(__FreeBSD__)
+# if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #  include <netinet/in.h>
 #  include <netinet/udp.h>
 #  define SOL_UDP IPPROTO_UDP
-# endif /* __NetBSD__ / __FreeBSD__ */
+# endif /* __NetBSD__ / __FreeBSD__ / __DragonFly__ */
 #endif
 
 static int nostate1 __P((struct ph1handle *, vchar_t *));
diff -ru ipsec-tools-0.6.5.orig/src/racoon/pfkey.c ipsec-tools-0.6.5/src/racoon/pfkey.c
--- ipsec-tools-0.6.5.orig/src/racoon/pfkey.c	2006-04-28 09:36:22.000000000 +0100
+++ ipsec-tools-0.6.5/src/racoon/pfkey.c	2006-04-28 13:38:27.000000000 +0100
@@ -47,7 +47,7 @@
 # ifdef __linux__
 #  include <linux/udp.h>
 # endif
-# if defined(__NetBSD__) || defined(__FreeBSD__)
+# if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #  include <netinet/udp.h>
 # endif
 #endif
diff -ru ipsec-tools-0.6.5.orig/src/setkey/token.c ipsec-tools-0.6.5/src/setkey/token.c
--- ipsec-tools-0.6.5.orig/src/setkey/token.c	2006-04-28 09:36:24.000000000 +0100
+++ ipsec-tools-0.6.5/src/setkey/token.c	2006-04-28 13:38:27.000000000 +0100
@@ -937,7 +937,7 @@
 #include <netdb.h>
 
 #include "vchar.h"
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__linux__)
 #include "parse.h"
 #else
 #include "y.tab.h"
diff -ru ipsec-tools-0.6.5.orig/src/setkey/token.l ipsec-tools-0.6.5/src/setkey/token.l
--- ipsec-tools-0.6.5.orig/src/setkey/token.l	2006-04-28 09:36:24.000000000 +0100
+++ ipsec-tools-0.6.5/src/setkey/token.l	2006-04-28 13:38:27.000000000 +0100
@@ -54,7 +54,7 @@
 #include <netdb.h>
 
 #include "vchar.h"
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__linux__)
 #include "parse.h"
 #else
 #include "y.tab.h"


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]