]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv4: Set oif in fib_compute_spec_dst
authorDavid Ahern <dsahern@gmail.com>
Sat, 7 Jul 2018 23:15:26 +0000 (16:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Jul 2018 01:54:58 +0000 (10:54 +0900)
commitebabceba7bd2124792722555dab604d15fea1b42
tree848d1134aedf7b4a52efb58863675e90a8b4925a
parent61b4b6afb0b64fcc6120bb4fb5ef6fb5b6f67cc6
net/ipv4: Set oif in fib_compute_spec_dst

Xin reported that icmp replies may not use the address on the device the
echo request is received if the destination address is broadcast. Instead
a route lookup is done without considering VRF context. Fix by setting
oif in flow struct to the master device if it is enslaved. That directs
the lookup to the VRF table. If the device is not enslaved, oif is still
0 so no affect.

Fixes: 5517be16488f ("net: Use VRF device index for lookups on RX")
Reported-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_frontend.c