diff options
author | Krzysztof Piotr Oledzki <ole@ans.pl> | 2008-06-11 00:44:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-11 00:44:49 +0200 |
commit | 709772e6e06564ed94ba740de70185ac3d792773 (patch) | |
tree | 17f94a2db1a8b47595a9440de0f7f375fae59134 /net/ipv4/fib_semantics.c | |
parent | ipsec: pfkey should ignore events when no listeners (diff) | |
download | linux-709772e6e06564ed94ba740de70185ac3d792773.tar.xz linux-709772e6e06564ed94ba740de70185ac3d792773.zip |
net: Fix routing tables with id > 255 for legacy software
Most legacy software do not like tables > 255 as rtm_table is u8
so tb_id is sent &0xff and it is possible to mismatch for example
table 510 with table 254 (main).
This patch introduces RT_TABLE_COMPAT=252 so the code uses it if
tb_id > 255. It makes such old applications happy, new
ones are still able to use RTA_TABLE to get a proper table id.
Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 3b83c34019fc..0d4d72827e4b 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -960,7 +960,10 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, rtm->rtm_dst_len = dst_len; rtm->rtm_src_len = 0; rtm->rtm_tos = tos; - rtm->rtm_table = tb_id; + if (tb_id < 256) + rtm->rtm_table = tb_id; + else + rtm->rtm_table = RT_TABLE_COMPAT; NLA_PUT_U32(skb, RTA_TABLE, tb_id); rtm->rtm_type = type; rtm->rtm_flags = fi->fib_flags; |