In some use cases, it is valuable to have the gateway
passed when deleting a route. Even if is ignored by
iproute2, custom tools selected via the --iproute option
can make use of it.

Signed-off-by: Mickael Chazaux <mickael.chaz...@gmail.com>
---

 route.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/route.c b/route.c
index cf9a5ea..6fd44ca 100644
--- a/route.c
+++ b/route.c
@@ -1718,10 +1718,12 @@ delete_route (struct route *r,

 #if defined(TARGET_LINUX)
 #ifdef CONFIG_FEATURE_IPROUTE
-  argv_printf (&argv, "%s route del %s/%d",
+  argv_printf (&argv, "%s route del %s/%d via %s",
             iproute_path,
             network,
-             count_netmask_bits(netmask));
+             count_netmask_bits(netmask),
+             gateway
+       );
 #else
  argv_printf (&argv, "%s del -net %s netmask %s",
              ROUTE_PATH,
--
1.7.0.4

Reply via email to