[PATCH] net: fib_rules: Correctly set table field when table number exceeds 8 bits

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE2396d

2 messages, 2 authors, 2020-02-17 · open the first message on its own page

[PATCH] net: fib_rules: Correctly set table field when table number exceeds 8 bits

From: Jethro Beekman <hidden>
Date: 2020-02-12 15:43:53

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 <redacted>
---
 net/core/fib_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 3e7e152..bd7eba9 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))
-- 
2.7.4

Re: [PATCH] net: fib_rules: Correctly set table field when table number exceeds 8 bits

From: David Miller <davem@davemloft.net>
Date: 2020-02-17 02:39:05

From: Jethro Beekman <redacted>
Date: Wed, 12 Feb 2020 16:43:41 +0100
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 <redacted>
Applied and queued up for -stable.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help