summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJethro Beekman <jethro@fortanix.com>2020-02-12 16:43:41 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-17 03:38:24 +0100
commit540e585a79e9d643ede077b73bcc7aa2d7b4d919 (patch)
treec471d0112d907bd455cce319df73244c5c7de209
parentnet/rds: Track user mapped pages through special API (diff)
downloadlinux-540e585a79e9d643ede077b73bcc7aa2d7b4d919.tar.xz
linux-540e585a79e9d643ede077b73bcc7aa2d7b4d919.zip
net: fib_rules: Correctly set table field when table number exceeds 8 bits
In 709772e6e06564ed94ba740de70185ac3d792773, RT_TABLE_COMPAT was added to allow legacy software to deal with routing table numbers >= 256, but the same change to FIB rule queries was overlooked. Signed-off-by: Jethro Beekman <jethro@fortanix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/fib_rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 3e7e15278c46..bd7eba9066f8 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -974,7 +974,7 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule,
frh = nlmsg_data(nlh);
frh->family = ops->family;
- frh->table = rule->table;
+ frh->table = rule->table < 256 ? rule->table : RT_TABLE_COMPAT;
if (nla_put_u32(skb, FRA_TABLE, rule->table))
goto nla_put_failure;
if (nla_put_u32(skb, FRA_SUPPRESS_PREFIXLEN, rule->suppress_prefixlen))