Signed-off-by: Xavier Franquet <[email protected]>
---
route.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/route.c b/route.c
index cb685c3..f361b07 100644
--- a/route.c
+++ b/route.c
@@ -1130,6 +1130,9 @@ add_route (struct route *r, const struct tuntap *tt,
unsigned int flags, const s
if (r->metric_defined)
argv_printf_cat (&argv, "metric %d", r->metric);
#endif /*CONFIG_FEATURE_IPROUTE*/
+ if (r->option->gateway == NULL || !strcmp(r->option->gateway,"vpn_gateway"))
+ argv_print (&argv, "dev %s", tt->actual_name);
+
argv_msg (D_ROUTE, &argv);
status = openvpn_execve_check (&argv, es, 0, "ERROR: Linux route add command
failed");
@@ -1478,6 +1481,10 @@ delete_route (const struct route *r, const struct tuntap
*tt, unsigned int flags
#endif /*CONFIG_FEATURE_IPROUTE*/
if (r->metric_defined)
argv_printf_cat (&argv, "metric %d", r->metric);
+
+ if (r->option->gateway == NULL || !strcmp(r->option->gateway,"vpn_gateway"))
+ argv_print (&argv, "dev %s", tt->actual_name);
+
argv_msg (D_ROUTE, &argv);
openvpn_execve_check (&argv, es, 0, "ERROR: Linux route delete command
failed");
--
1.7.1