]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
net: icmp6_send should use dst dev to determine L3 domain
authorDavid Ahern <dsa@cumulusnetworks.com>
Thu, 3 Nov 2016 23:17:26 +0000 (16:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Nov 2016 01:30:19 +0000 (20:30 -0500)
icmp6_send is called in response to some event. The skb may not have
the device set (skb->dev is NULL), but it is expected to have a dst set.
Update icmp6_send to use the dst on the skb to determine L3 domain.

Fixes: ca254490c8dfd ("net: Add VRF support to IPv6 stack")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/icmp.c

index bd59c343d35f297ff6c0462cac4cc76c6c9b76ed..7370ad2e693a33d7db78c311c7e47c001c80df7c 100644 (file)
@@ -448,7 +448,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
        if (__ipv6_addr_needs_scope_id(addr_type))
                iif = skb->dev->ifindex;
        else
-               iif = l3mdev_master_ifindex(skb->dev);
+               iif = l3mdev_master_ifindex(skb_dst(skb)->dev);
 
        /*
         *      Must not send error if the source does not uniquely