David,

Could you take a look over the following attached patches and comments
and make a consideration on these.


Thanks.


-- 

 - (2^(N-1))
------------------------------------------------------------------------
r2 | jh | 2012-06-14 01:14:16 -0400 (Thu, 14 Jun 2012) | 4 lines


ASCII'fy the copyrights section. less(1) and other tools see it as binary.



Index: vpnc-script
===================================================================
--- vpnc-script	(revision 1)
+++ vpnc-script	(revision 2)
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
 # Originally part of vpnc source code:
-# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
-# © 2009-2012 David Woodhouse <dw...@infradead.org>
+# (c) 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
+# (c) 2009-2012 David Woodhouse <dw...@infradead.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

------------------------------------------------------------------------
r3 | jh | 2012-06-14 01:25:31 -0400 (Thu, 14 Jun 2012) | 13 lines


Adjust checking for if_tun to use kldstat(8) in place of /dev/tun

/dev/tun is legacy usage and should be discouraged from further use. When
sysctl net.link.tun.devfs_cloning=0 there is no /dev/tun device to probe.
kldstat(8) and the current flags (-qm) for FreeBSD reach back to 7.X and
possibly further, so invoke them.

While here kldload if_tun.ko quietly (-q)

See if_tun(4), kldstat(8), kldload(8)



Index: vpnc-script
===================================================================
--- vpnc-script	(revision 2)
+++ vpnc-script	(revision 3)
@@ -593,12 +593,12 @@
 			fi
 		fi
 	elif [ "$OS" = "FreeBSD" ]; then
-		if [ ! -e /dev/tun ]; then
-			kldload if_tun
+		if ! kldstat -qm if_tun; then
+			kldload -q if_tun
 		fi
 	elif [ "$OS" = "GNU/kFreeBSD" ]; then
-		if [ ! -e /dev/tun ]; then
-			kldload if_tun
+		if ! kldstat -qm if_tun; then
+			kldload -q if_tun
 		fi
 	elif [ "$OS" = "NetBSD" ]; then
 		:

------------------------------------------------------------------------
r4 | jh | 2012-06-14 01:42:30 -0400 (Thu, 14 Jun 2012) | 11 lines


Interface creation and deletion should be handled directly by vpnc and
return status should be handed back over to the script for negotiation.

For now comment out the implicit tunnel deletion function until it can be
reworked.

Things to consider are possible legacy use cases net.link.tun.devfs_cloning
but should not be depended on.



Index: vpnc-script
===================================================================
--- vpnc-script	(revision 3)
+++ vpnc-script	(revision 4)
@@ -712,7 +712,7 @@
 	if [ -n "$INTERNAL_IP4_DNS" ]; then
 		$RESTORERESOLVCONF
 	fi
-	destroy_tun_device
+	#destroy_tun_device
 }
 
 #### Main

------------------------------------------------------------------------

Attachment: pgp8weoFh0DnY.pgp
Description: PGP signature

Reply via email to