Fix vxlan-gpe next protocol value 28/2428/2
authorYi Yang <[email protected]>
Thu, 18 Aug 2016 06:06:52 +0000 (14:06 +0800)
committerFlorin Coras <[email protected]>
Thu, 25 Aug 2016 13:06:26 +0000 (13:06 +0000)
vxlan4_gpe_rewrite and vxlan6_gpe_rewrite used the fixed value
VXLAN_GPE_PROTOCOL_IP4 for next protocol regardless of vxlan-gpe
port next protocol, this commit fixed it and used the value from
vxlan-gpe port.

Change-Id: I22ba25fbde1c0630960cbcfd196e14231fbf1af3
Signed-off-by: Yi Yang <[email protected]>
vnet/vnet/vxlan-gpe/vxlan_gpe.c

index f54d46c..e032d56 100644 (file)
@@ -162,7 +162,7 @@ static int vxlan4_gpe_rewrite (vxlan_gpe_tunnel_t * t)
   /* VXLAN header. Are we having fun yet? */
   h0->vxlan.flags = VXLAN_GPE_FLAGS_I | VXLAN_GPE_FLAGS_P;
   h0->vxlan.ver_res = VXLAN_GPE_VERSION;
-  h0->vxlan.protocol = VXLAN_GPE_PROTOCOL_IP4;
+  h0->vxlan.protocol = t->protocol;
   h0->vxlan.vni_res = clib_host_to_net_u32 (t->vni<<8);
 
   t->rewrite = rw;
@@ -200,7 +200,7 @@ static int vxlan6_gpe_rewrite (vxlan_gpe_tunnel_t * t)
   /* VXLAN header. Are we having fun yet? */
   h0->vxlan.flags = VXLAN_GPE_FLAGS_I | VXLAN_GPE_FLAGS_P;
   h0->vxlan.ver_res = VXLAN_GPE_VERSION;
-  h0->vxlan.protocol = VXLAN_GPE_PROTOCOL_IP4;
+  h0->vxlan.protocol = t->protocol;
   h0->vxlan.vni_res = clib_host_to_net_u32 (t->vni<<8);
 
   t->rewrite = rw;