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>
This commit is contained in:
Romary Sonrier 2012-03-03 01:46:46 +01:00 committed by Thomas Graf
parent f7d06614fc
commit 965fd78042
2 changed files with 7 additions and 0 deletions

View file

@ -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]));

View file

@ -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);