$OpenBSD: patch-vpnc-script_in,v 1.1.1.1 2011/12/08 13:55:28 sthen Exp $
--- vpnc-script.orig	Thu Dec  8 13:18:54 2011
+++ vpnc-script	Thu Dec  8 13:22:05 2011
@@ -59,7 +59,7 @@ if [ ! -d "/var/run/vpnc" ]; then
 fi
 
 # stupid SunOS: no blubber in /usr/local/bin ... (on stdout)
-IPROUTE="`which ip | grep '^/' 2> /dev/null`"
+IPROUTE="`which ip 2> /dev/null | grep '^/'`"
 
 if [ "$OS" = "Linux" ]; then
 	ifconfig_syntax_ptp="pointopoint"
@@ -141,7 +141,7 @@ do_ifconfig() {
 
 destroy_tun_device() {
 	case "$OS" in
-	NetBSD|FreeBSD) # and probably others...
+	NetBSD|FreeBSD|OpenBSD) # and probably others...
 		ifconfig "$TUNDEV" destroy
 		;;
         SunOS)
@@ -266,7 +266,7 @@ else # use route command
 
 	del_network_route() {
 		case "$OS" in
-		Linux|NetBSD|Darwin|SunOS) # and probably others...
+		Linux|NetBSD|Darwin|SunOS|OpenBSD) # and probably others...
 			# routes are deleted automatically on device shutdown
 			return
 			;;
@@ -524,7 +524,9 @@ do_pre_init() {
 	elif [ "$OS" = "NetBSD" ]; then
 		:
 	elif [ "$OS" = "OpenBSD" ]; then
-		:
+		if ! ifconfig $TUNDEV > /dev/null; then
+			ifconfig $TUNDEV create
+		fi
 	elif [ "$OS" = "SunOS" ]; then
 		:
 	elif [ "$OS" = "Darwin" ]; then
