Skip to content

Commit 78382d7

Browse files
dsaherngregkh
authored andcommitted
net/ipv4: Set oif in fib_compute_spec_dst
[ Upstream commit e737219 ] 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: cd2fbe1 ("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>
1 parent 829f4fd commit 78382d7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎net/ipv4/fib_frontend.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb)
290290
if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) {
291291
struct flowi4 fl4 = {
292292
.flowi4_iif = LOOPBACK_IFINDEX,
293+
.flowi4_oif = l3mdev_master_ifindex_rcu(dev),
293294
.daddr = ip_hdr(skb)->saddr,
294295
.flowi4_tos = RT_TOS(ip_hdr(skb)->tos),
295296
.flowi4_scope = scope,

0 commit comments

Comments
 (0)