treewide: fix replace nbd@openwrt.org with nbd@nbd.name
[openwrt.git] / package / utils / busybox / patches / 020-networking-libiproute-fix-displaying-route-table-for.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 7 Feb 2016 21:11:21 +0100
3 Subject: [PATCH] networking/libiproute: fix displaying route table for rules
4
5 r->rtm_table only supports a 8 bit table id, prefer RTA_TABLE if
6 present.
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
11 --- a/networking/libiproute/iprule.c
12 +++ b/networking/libiproute/iprule.c
13 @@ -119,7 +119,9 @@ static int FAST_FUNC print_rule(const st
14                 printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF]));
15         }
16  
17 -       if (r->rtm_table)
18 +       if (tb[RTA_TABLE])
19 +               printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE])));
20 +       else if (r->rtm_table)
21                 printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table));
22  
23         if (tb[RTA_FLOW]) {