diff options
author | Gert Doering <gert@greenie.muc.de> | 2010-10-30 21:03:16 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2010-11-12 21:54:08 +0100 |
commit | f0eac1a5979096c671b3674f9d80871f496d1da8 (patch) | |
tree | 6b6cdffe0d1163fc9758f88de9c2e2d8d5dedadf /tun.c | |
parent | Integrate support for TAP mode on Solaris, written by Kazuyoshi Aizawa <admin... (diff) | |
download | openvpn-f0eac1a5979096c671b3674f9d80871f496d1da8.tar.xz |
Make "topology subnet" work on Solaris (ifconfig + route metric changes by Kazuyoshi Aizawa, adding of local "connected subnet" route by me)
Tested on OpenSolaris/i386, no impact for other TARGETs.
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Kazuyoshi Aizawa <admin2@whiteboard.ne.jp>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to '')
-rw-r--r-- | tun.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -702,6 +702,19 @@ do_ifconfig (struct tuntap *tt, ); } else + 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 broadcast + up", IFCONFIG_PATH, @@ -714,6 +727,20 @@ do_ifconfig (struct tuntap *tt, if (!openvpn_execve_check (&argv, es, 0, "Solaris ifconfig phase-2 failed")) solaris_error_close (tt, es, actual); + if (!tun && tt->topology == TOP_SUBNET) + { + /* Add a network route for the local tun interface */ + struct route r; + CLEAR (r); + r.defined = true; + r.network = tt->local & tt->remote_netmask; + r.netmask = tt->remote_netmask; + r.gateway = tt->local; + r.metric_defined = true; + r.metric = 0; + add_route (&r, tt, 0, es); + } + tt->did_ifconfig = true; #elif defined(TARGET_OPENBSD) |