$OpenBSD: patch-src_openvpn_tun_c,v 1.1 2013/04/20 16:22:55 sthen Exp $
--- src/openvpn/tun.c.orig	Wed Mar 20 09:28:14 2013
+++ src/openvpn/tun.c	Mon Apr  1 17:55:36 2013
@@ -911,7 +911,19 @@ do_ifconfig (struct tuntap *tt,
 			  );
 	}
       else
-	argv_printf (&argv,
+      {
+        if (tt->topology == TOP_SUBNET)
+          argv_printf (&argv,
+                              "%s %s %s %s netmask %s mtu %d up",
+                              IFCONFIG_PATH,
+                              actual,
+                              ifconfig_local,
+                              ifconfig_local,
+                              ifconfig_remote_netmask,
+                              tun_mtu
+                              );
+        else
+	  argv_printf (&argv,
 			  "%s %s %s netmask %s mtu %d broadcast %s link0",
 			  IFCONFIG_PATH,
 			  actual,
@@ -920,6 +932,7 @@ do_ifconfig (struct tuntap *tt,
 			  tun_mtu,
 			  ifconfig_broadcast
 			  );
+      }
       argv_msg (M_INFO, &argv);
       openvpn_execve_check (&argv, es, S_FATAL, "OpenBSD ifconfig failed");
       if ( do_ipv6 )
@@ -938,6 +951,18 @@ do_ifconfig (struct tuntap *tt,
 	  add_route_connected_v6_net(tt, es);
 	}
       tt->did_ifconfig = true;
+
+      /* Add a network route for the local tun interface */
+      if (!tun && tt->topology == TOP_SUBNET)
+        {
+          struct route r;
+          CLEAR (r);
+          r.flags = RT_DEFINED;
+          r.network = tt->local & tt->remote_netmask;
+          r.netmask = tt->remote_netmask;
+          r.gateway = tt->local;
+          add_route (&r, tt, 0, NULL, es);
+        }
 
 #elif defined(TARGET_NETBSD)
 
