diff options
Diffstat (limited to 'openvpn/src/openvpn/init.c')
-rw-r--r-- | openvpn/src/openvpn/init.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/openvpn/src/openvpn/init.c b/openvpn/src/openvpn/init.c index bc7718e4..88d621a4 100644 --- a/openvpn/src/openvpn/init.c +++ b/openvpn/src/openvpn/init.c @@ -1477,6 +1477,13 @@ do_open_tun (struct context *c) &gc); do_ifconfig (c->c1.tuntap, guess, TUN_MTU_SIZE (&c->c2.frame), c->c2.es); } + + /* possibly add routes */ + if(ifconfig_order() == ROUTE_BEFORE_TUN) { + if (!c->options.route_delay_defined) + do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list, + c->c1.tuntap, c->plugins, c->c2.es); + } /* open the tun device */ open_tun (c->options.dev, c->options.dev_type, c->options.dev_node, @@ -1509,10 +1516,11 @@ do_open_tun (struct context *c) c->c2.es); /* possibly add routes */ + if(ifconfig_order() == ROUTE_AFTER_TUN) { if (!c->options.route_delay_defined) do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list, c->c1.tuntap, c->plugins, c->c2.es); - + } /* * Did tun/tap driver give us an MTU? */ |