]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jul 2018 09:24:01 +0000 (11:24 +0200)
commitf08ca4c8b423c3cbfc254b73d1c12e622bd63c10
tree3b977dca552dcf1187dbb7fec641c535b20492a2
parent66a7cfa05740341e6cceab4694b4ace7ce88475f
net/ipv4: Set oif in fib_compute_spec_dst

[ Upstream commit e7372197e15856ec4ee66b668020a662994db103 ]

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: cd2fbe1b6b51 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/fib_frontend.c