ip: do not clear the locally-originated flag 28/26428/1
authorNeale Ranns <nranns@cisco.com>
Wed, 8 Apr 2020 12:28:06 +0000 (08:28 -0400)
committerNeale Ranns <nranns@cisco.com>
Wed, 8 Apr 2020 12:28:06 +0000 (08:28 -0400)
Type: fix

 - doing so in MTU dec, means mtu_inc is broken
 - there's no need to. if a packet encounters ipX-rewrite a second time then it went through a tunnel the first time and is still locally originated.

Change-Id: I0f279c2837b608c1677485fe93f63398ab2737b3
Signed-off-by: Neale Ranns <nranns@cisco.com>
src/vnet/ip/ip4_forward.c
src/vnet/ip/ip6_forward.c

index 7471a00..c945f70 100644 (file)
@@ -1990,10 +1990,7 @@ ip4_ttl_inc (vlib_buffer_t * b, ip4_header_t * ip)
   i32 ttl;
   u32 checksum;
   if (PREDICT_FALSE (b->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED))
-    {
-      b->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
-      return;
-    }
+    return;
 
   ttl = ip->ttl;
 
@@ -2016,10 +2013,7 @@ ip4_ttl_and_checksum_check (vlib_buffer_t * b, ip4_header_t * ip, u16 * next,
   i32 ttl;
   u32 checksum;
   if (PREDICT_FALSE (b->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED))
-    {
-      b->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
-      return;
-    }
+    return;
 
   ttl = ip->ttl;
 
index f7f7b78..b7cdb1a 100644 (file)
@@ -1744,10 +1744,7 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm,
                                               0);
                }
            }
-         else
-           {
-             p0->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
-           }
+
          is_locally_originated1 =
            p1->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED;
          if (PREDICT_TRUE (!is_locally_originated1))
@@ -1775,10 +1772,7 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm,
                                               0);
                }
            }
-         else
-           {
-             p1->flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
-           }
+
          adj0 = adj_get (adj_index0);
          adj1 = adj_get (adj_index1);