aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2013-11-07 18:26:38 +0100
committerZiyann <jaraidaniel@gmail.com>2014-11-26 21:32:10 +0100
commit262ba71cb628cc48bb06c78b8735a7a44dd0bb9c (patch)
tree6e970f9a58c1d1931748c430e227b7873135635d /net
parent2508cc4d25f4672df4f7ce076da091fef252c42d (diff)
downloadkernel_samsung_tuna-262ba71cb628cc48bb06c78b8735a7a44dd0bb9c.zip
kernel_samsung_tuna-262ba71cb628cc48bb06c78b8735a7a44dd0bb9c.tar.gz
kernel_samsung_tuna-262ba71cb628cc48bb06c78b8735a7a44dd0bb9c.tar.bz2
net: Fix "ip rule delete table 256"
[ Upstream commit 13eb2ab2d33c57ebddc57437a7d341995fc9138c ] 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/724783 Reported-by: Nicolas HICHER <nhicher@avencall.com> Signed-off-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/fib_rules.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index abe9ced..d11a019 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -483,7 +483,8 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
if (frh->action && (frh->action != rule->action))
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;
if (tb[FRA_PRIORITY] &&