From 52a8d975da9c6b26fc7f6323a78556208cf0cd64 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 8 Jun 2008 00:25:55 +0000 Subject: [PATCH] ip: make numeric table work: "ip route list table 255". closes bug 3664. function old new delta iproute_list_or_flush 1270 1300 +30 --- networking/libiproute/iproute.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index 1f6479454..59cbf8073 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c @@ -576,8 +576,16 @@ static int iproute_list_or_flush(char **argv, int flush) filter.tb = -1; else if (parm == KW_all) filter.tb = 0; - else if (parm != KW_main) + else if (parm != KW_main) { +#if ENABLE_FEATURE_IP_RULE + uint32_t tid; + if (rtnl_rttable_a2n(&tid, *argv)) + invarg(*argv, "table"); + filter.tb = tid; +#else invarg(*argv, "table"); +#endif + } } else if (arg == KW_cache) { /* The command 'ip route flush cache' is used by OpenSWAN. * Assuming it's a synonym for 'ip route flush table cache' */