Revert "vrf: mark skb for multicast or link-local as enslaved to VRF"
authorSasha Levin <sashal@kernel.org>
Mon, 23 Mar 2020 20:21:31 +0000 (16:21 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 14:34:21 +0000 (16:34 +0200)
This reverts commit 2271c9500434af2a26b2c9eadeb3c0b075409fb5.

This patch shouldn't have been backported to 4.14.

Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/vrf.c

index e0cea5c05f0e27cbf3fd8f8f99a6a0c947f0d7ab..03e4fcdfeab7359eef0b93ee567ba2f5c40b6716 100644 (file)
@@ -996,23 +996,24 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev,
                                   struct sk_buff *skb)
 {
        int orig_iif = skb->skb_iif;
-       bool need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr);
-       bool is_ndisc = ipv6_ndisc_frame(skb);
+       bool need_strict;
 
-       /* loopback, multicast & non-ND link-local traffic; do not push through
-        * packet taps again. Reset pkt_type for upper layers to process skb
+       /* loopback traffic; do not push through packet taps again.
+        * Reset pkt_type for upper layers to process skb
         */
-       if (skb->pkt_type == PACKET_LOOPBACK || (need_strict && !is_ndisc)) {
+       if (skb->pkt_type == PACKET_LOOPBACK) {
                skb->dev = vrf_dev;
                skb->skb_iif = vrf_dev->ifindex;
                IP6CB(skb)->flags |= IP6SKB_L3SLAVE;
-               if (skb->pkt_type == PACKET_LOOPBACK)
-                       skb->pkt_type = PACKET_HOST;
+               skb->pkt_type = PACKET_HOST;
                goto out;
        }
 
-       /* if packet is NDISC then keep the ingress interface */
-       if (!is_ndisc) {
+       /* if packet is NDISC or addressed to multicast or link-local
+        * then keep the ingress interface
+        */
+       need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr);
+       if (!ipv6_ndisc_frame(skb) && !need_strict) {
                vrf_rx_stats(vrf_dev, skb->len);
                skb->dev = vrf_dev;
                skb->skb_iif = vrf_dev->ifindex;