diff options
author | Gert Doering <gert@greenie.muc.de> | 2013-03-26 17:09:35 +0100 |
---|---|---|
committer | Gert Doering <gert@greenie.muc.de> | 2013-03-27 09:36:37 +0100 |
commit | 792e8956b999b6932d472e4ab592bff160e52888 (patch) | |
tree | 82a1e6ddf39eea5c2b18e33df8eaed62233b3712 /src/openvpn/route.c | |
parent | 15ca5c297b556fbbfdee6152af26ee158222614f (diff) | |
download | openvpn-792e8956b999b6932d472e4ab592bff160e52888.tar.gz openvpn-792e8956b999b6932d472e4ab592bff160e52888.tar.xz openvpn-792e8956b999b6932d472e4ab592bff160e52888.zip |
Fix directly connected routes for "topology subnet" on Solaris.
This basically brings back the previously-working metric setting for
directly connected routes (add a "0" to the "route add" command) on
Solaris/OpenSolaris. It was working in f0eac1a59790, and got broken
by the route.c/route.h refactoring in 576dc96ca1ef1 - the patch
un-does that change to the TARGET_SOLARIS code, plus adds some more
descriptive comments.
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Josh Cepek <josh.cepek@usa.net>
Message-Id: <1364314175-20758-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7460
Diffstat (limited to 'src/openvpn/route.c')
-rw-r--r-- | src/openvpn/route.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 134ed58..4c1e14e 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1397,17 +1397,20 @@ add_route (struct route *r, argv_printf (&argv, "%s add", ROUTE_PATH); -#if 0 - if (r->flags & RT_METRIC_DEFINED) - argv_printf_cat (&argv, "-rtt %d", r->metric); -#endif - argv_printf_cat (&argv, "%s -netmask %s %s", network, netmask, gateway); - /* FIXME -- add on-link support for Solaris */ + /* Solaris can only distinguish between "metric 0" == "on-link on the + * interface where the IP address given is configured" and "metric > 0" + * == "use gateway specified" (no finer-grained route metrics available) + * + * More recent versions of Solaris can also do "-interface", but that + * would break backwards compatibility with older versions for no gain. + */ + if (r->flags & RT_METRIC_DEFINED ) + argv_printf_cat (&argv, "%d", r->metric); argv_msg (D_ROUTE, &argv); status = openvpn_execve_check (&argv, es, 0, "ERROR: Solaris route add command failed"); |