diff options
author | Hongjun Ni <hongjun.ni@intel.com> | 2016-10-27 18:39:44 +0800 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2016-11-07 14:58:58 +0000 |
commit | e74c1dc577edf19d485e8a37977b06f502cc76bd (patch) | |
tree | 49e5ef552e4602040780dcf94239e85bd0707dd8 | |
parent | d2017f6de1371cc237ad1a86588091232e2c7b37 (diff) |
Fix dual-loop issue in vxlan_gpe decap
From logical point, if first packet is ipv4, and second packet is ipv6.
When first packet failed, the procedure will skip key6_1 setting.
This will lead to second packet's failure.
But here the graph node only process either ipv4 or ipv6 packets completely.
So it is not an issue here.
This patch only make the packet processig's logic clear. It is just a cosmetic change.
Change-Id: I0104ebf2546208d9068000649ce6dccdeeb5aa79
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
-rw-r--r-- | vnet/vnet/vxlan-gpe/decap.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/vnet/vnet/vxlan-gpe/decap.c b/vnet/vnet/vxlan-gpe/decap.c index 7eca3f6b8dc..f6d1402d3f0 100644 --- a/vnet/vnet/vxlan-gpe/decap.c +++ b/vnet/vnet/vxlan-gpe/decap.c @@ -227,7 +227,31 @@ vxlan_gpe_input (vlib_main_t * vm, key4_0.pad = 0; key4_1.pad = 0; + } + else /* is_ip6 */ + { + next0 = (iuvn6_0->vxlan.protocol < node->n_next_nodes) ? + iuvn6_0->vxlan.protocol : VXLAN_GPE_INPUT_NEXT_DROP; + next1 = (iuvn6_1->vxlan.protocol < node->n_next_nodes) ? + iuvn6_1->vxlan.protocol : VXLAN_GPE_INPUT_NEXT_DROP; + + key6_0.local.as_u64[0] = iuvn6_0->ip6.dst_address.as_u64[0]; + key6_0.local.as_u64[1] = iuvn6_0->ip6.dst_address.as_u64[1]; + key6_1.local.as_u64[0] = iuvn6_1->ip6.dst_address.as_u64[0]; + key6_1.local.as_u64[1] = iuvn6_1->ip6.dst_address.as_u64[1]; + + key6_0.remote.as_u64[0] = iuvn6_0->ip6.src_address.as_u64[0]; + key6_0.remote.as_u64[1] = iuvn6_0->ip6.src_address.as_u64[1]; + key6_1.remote.as_u64[0] = iuvn6_1->ip6.src_address.as_u64[0]; + key6_1.remote.as_u64[1] = iuvn6_1->ip6.src_address.as_u64[1]; + + key6_0.vni = iuvn6_0->vxlan.vni_res; + key6_1.vni = iuvn6_1->vxlan.vni_res; + } + /* Processing packet 0*/ + if (is_ip4) + { /* Processing for key4_0 */ if (PREDICT_FALSE((key4_0.as_u64[0] != last_key4.as_u64[0]) || (key4_0.as_u64[1] != last_key4.as_u64[1]))) @@ -249,24 +273,6 @@ vxlan_gpe_input (vlib_main_t * vm, } else /* is_ip6 */ { - next0 = (iuvn6_0->vxlan.protocol < node->n_next_nodes) ? - iuvn6_0->vxlan.protocol : VXLAN_GPE_INPUT_NEXT_DROP; - next1 = (iuvn6_1->vxlan.protocol < node->n_next_nodes) ? - iuvn6_1->vxlan.protocol : VXLAN_GPE_INPUT_NEXT_DROP; - - key6_0.local.as_u64[0] = iuvn6_0->ip6.dst_address.as_u64[0]; - key6_0.local.as_u64[1] = iuvn6_0->ip6.dst_address.as_u64[1]; - key6_1.local.as_u64[0] = iuvn6_1->ip6.dst_address.as_u64[0]; - key6_1.local.as_u64[1] = iuvn6_1->ip6.dst_address.as_u64[1]; - - key6_0.remote.as_u64[0] = iuvn6_0->ip6.src_address.as_u64[0]; - key6_0.remote.as_u64[1] = iuvn6_0->ip6.src_address.as_u64[1]; - key6_1.remote.as_u64[0] = iuvn6_1->ip6.src_address.as_u64[0]; - key6_1.remote.as_u64[1] = iuvn6_1->ip6.src_address.as_u64[1]; - - key6_0.vni = iuvn6_0->vxlan.vni_res; - key6_1.vni = iuvn6_1->vxlan.vni_res; - /* Processing for key6_0 */ if (PREDICT_FALSE(memcmp (&key6_0, &last_key6, sizeof(last_key6)) != 0)) { |