[PATCH] networking/libiproute: fix displaying route table for rules

Felix Fietkau nbd at openwrt.org
Sun Feb 7 20:13:39 UTC 2016


r->rtm_table only supports a 8 bit table id, prefer RTA_TABLE if
present.

Signed-off-by: Felix Fietkau <nbd at openwrt.org>
---
 networking/libiproute/iprule.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index dba6434..64f4909 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM,
 		printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF]));
 	}
 
-	if (r->rtm_table)
+	if (tb[RTA_TABLE])
+		printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE])));
+	else if (r->rtm_table)
 		printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table));
 
 	if (tb[RTA_FLOW]) {
-- 
2.2.2



More information about the busybox mailing list