ipv4: mask tos for input route
authorJulian Anastasov <ja@ssi.bg>
Sun, 26 Feb 2017 15:14:35 +0000 (17:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Feb 2017 16:03:38 +0000 (11:03 -0500)
Restore the lost masking of TOS in input route code to
allow ip rules to match it properly.

Problem [1] noticed by Shmulik Ladkani <shmulik.ladkani@gmail.com>

[1] http://marc.info/?t=137331755300040&r=1&w=2

Fixes: 89aef8921bfb ("ipv4: Delete routing cache.")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index 584ed667bfa4382aaad7cdb3a48c20cefc58cdfd..8471dd116771462d149e1da2807e446b69b74bcc 100644 (file)
@@ -2009,6 +2009,7 @@ int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 {
        int res;
 
+       tos &= IPTOS_RT_MASK;
        rcu_read_lock();
 
        /* Multicast recognition logic is moved from route cache to here.