diff options
author | Paolo Abeni <pabeni@redhat.com> | 2023-09-21 21:49:45 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-09-21 21:49:45 +0200 |
commit | e9cbc89067cce78211c8629c78e931c0fe64e29d (patch) | |
tree | 95662373d0a7b4adc589fec61e120586d476de71 /net/ipv4/route.c | |
parent | f30e5323a188cfc2d74b04f222cea0dbe9ffd6e6 (diff) | |
parent | 27bbf45eae9ca98877a2d52a92a188147cd61b07 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR.
No conflicts.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index fb3045692b99..ac332e2e4fff 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1213,6 +1213,7 @@ EXPORT_INDIRECT_CALLABLE(ipv4_dst_check); static void ipv4_send_dest_unreach(struct sk_buff *skb) { + struct net_device *dev; struct ip_options opt; int res; @@ -1230,7 +1231,8 @@ static void ipv4_send_dest_unreach(struct sk_buff *skb) opt.optlen = ip_hdr(skb)->ihl * 4 - sizeof(struct iphdr); rcu_read_lock(); - res = __ip_options_compile(dev_net(skb->dev), &opt, skb, NULL); + dev = skb->dev ? skb->dev : skb_rtable(skb)->dst.dev; + res = __ip_options_compile(dev_net(dev), &opt, skb, NULL); rcu_read_unlock(); if (res) |