Thread (5 messages) flat view 5 messages, 3 authors, 2021-06-21

Re: [PATCH net] vrf: do not push non-ND strict packets with a source LLA through packet taps again

From: Antoine Tenart <atenart@kernel.org>
Date: 2021-06-20 12:12:38

Quoting David Ahern (2021-06-19 03:18:50)
On 6/18/21 9:15 AM, Antoine Tenart wrote:
quoted
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1366,22 +1366,22 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev,
      int orig_iif = skb->skb_iif;
      bool need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr);
      bool is_ndisc = ipv6_ndisc_frame(skb);
-     bool is_ll_src;
 
      /* loopback, multicast & non-ND link-local traffic; do not push through
       * packet taps again. Reset pkt_type for upper layers to process skb.
-      * for packets with lladdr src, however, skip so that the dst can be
-      * determine at input using original ifindex in the case that daddr
-      * needs strict
+      * For strict packets with a source LLA, determine the dst using the
+      * original ifindex.
       */
-     is_ll_src = ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL;
-     if (skb->pkt_type == PACKET_LOOPBACK ||
-         (need_strict && !is_ndisc && !is_ll_src)) {
+     if (skb->pkt_type == PACKET_LOOPBACK || (need_strict && !is_ndisc)) {
              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;
+             else if (ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)
+                     vrf_ip6_input_dst(skb, vrf_dev, orig_iif);
+
              goto out;
      }
you are basically moving Stephen's is_ll_src within the need_strict and
not ND.
That's right.
Did you run the fcnal-test script and verify no change in test results?
Yes, I saw no regression, and the tests Stephen added were still OK.

Antoine
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help