aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iprule.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute/iprule.c')
-rw-r--r--networking/libiproute/iprule.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index c486834b0..8f3f86286 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,
114 printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF])); 114 printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF]));
115 } 115 }
116 116
117 if (r->rtm_table) 117 if (tb[RTA_TABLE])
118 printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE])));
119 else if (r->rtm_table)
118 printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); 120 printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table));
119 121
120 if (tb[RTA_FLOW]) { 122 if (tb[RTA_FLOW]) {
@@ -256,7 +258,12 @@ static int iprule_modify(int cmd, char **argv)
256 NEXT_ARG(); 258 NEXT_ARG();
257 if (rtnl_rttable_a2n(&tid, *argv)) 259 if (rtnl_rttable_a2n(&tid, *argv))
258 invarg_1_to_2(*argv, "table ID"); 260 invarg_1_to_2(*argv, "table ID");
259 req.r.rtm_table = tid; 261 if (tid < 256)
262 req.r.rtm_table = tid;
263 else {
264 req.r.rtm_table = RT_TABLE_UNSPEC;
265 addattr32(&req.n, sizeof(req), RTA_TABLE, tid);
266 }
260 table_ok = 1; 267 table_ok = 1;
261 } else if (key == ARG_dev || 268 } else if (key == ARG_dev ||
262 key == ARG_iif 269 key == ARG_iif