Commit 13eb2ab2 authored by Andreas Henriksson's avatar Andreas Henriksson Committed by David S. Miller

net: Fix "ip rule delete table 256"

When trying to delete a table >= 256 using iproute2 the local table
will be deleted.
The table id is specified as a netlink attribute when it needs more then
8 bits and iproute2 then sets the table field to RT_TABLE_UNSPEC (0).
Preconditions to matching the table id in the rule delete code
doesn't seem to take the "table id in netlink attribute" into condition
so the frh_get_table helper function never gets to do its job when
matching against current rule.
Use the helper function twice instead of peaking at the table value directly.

Originally reported at: http://bugs.debian.org/724783Reported-by: default avatarNicolas HICHER <nhicher@avencall.com>
Signed-off-by: default avatarAndreas Henriksson <andreas@fatal.se>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 394055f6
...@@ -460,7 +460,8 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh) ...@@ -460,7 +460,8 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh)
if (frh->action && (frh->action != rule->action)) if (frh->action && (frh->action != rule->action))
continue; continue;
if (frh->table && (frh_get_table(frh, tb) != rule->table)) if (frh_get_table(frh, tb) &&
(frh_get_table(frh, tb) != rule->table))
continue; continue;
if (tb[FRA_PRIORITY] && if (tb[FRA_PRIORITY] &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment