summaryrefslogtreecommitdiff
path: root/lib/route
diff options
context:
space:
mode:
authorRomary Sonrier <romary@sonrier.com>2012-03-03 01:46:46 +0100
committerThomas Graf <tgraf@redhat.com>2012-03-06 10:15:30 +0100
commit965fd78042652693cca1c07efcce2f932b405ca7 (patch)
treecd830995f6a87cf23fc7d333f564f4968f183976 /lib/route
parentf7d06614fc233db2ef2a6bce2bcde18dc019be3b (diff)
downloadlibnl-965fd78042652693cca1c07efcce2f932b405ca7.tar.gz
missing extended Table attribute for lib/route/
I found a small bug in libnl, about extended table id ( above 256 ). Signed-off-by: Romary Sonrier <romary@sonrier.com> Signed-off-by: Thomas Graf <tgraf@redhat.com>
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/route_obj.c3
-rw-r--r--lib/route/rule.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c
index d322633..ac634ae 100644
--- a/lib/route/route_obj.c
+++ b/lib/route/route_obj.c
@@ -914,6 +914,9 @@ int rtnl_route_parse(struct nlmsghdr *nlh, struct rtnl_route **result)
nl_addr_put(src);
}
+ if (tb[RTA_TABLE])
+ rtnl_route_set_table(route, nla_get_u32(tb[RTA_TABLE]));
+
if (tb[RTA_IIF])
rtnl_route_set_iif(route, nla_get_u32(tb[RTA_IIF]));
diff --git a/lib/route/rule.c b/lib/route/rule.c
index 1a695cd..076ca51 100644
--- a/lib/route/rule.c
+++ b/lib/route/rule.c
@@ -383,6 +383,10 @@ static int build_rule_msg(struct rtnl_rule *tmpl, int cmd, int flags,
if (nlmsg_append(msg, &frh, sizeof(frh), NLMSG_ALIGNTO) < 0)
goto nla_put_failure;
+ /* Additional table attribute replacing the 8bit in the header, was
+ * required to allow more than 256 tables. */
+ NLA_PUT_U32(msg, FRA_TABLE, tmpl->r_table);
+
if (tmpl->ce_mask & RULE_ATTR_SRC)
NLA_PUT_ADDR(msg, FRA_SRC, tmpl->r_src);