X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgtpu%2Fgtpu_encap.c;h=4442c42ad66a7d55605652fda718bb03f176a7cc;hb=d6dfd002328676eddda3b90bf46af0128a119b75;hp=5c37f4db306c9ec9aa884f6da55fa4e724e2853d;hpb=96cc67dd80e7fbf56071925afff056929965af6d;p=vpp.git diff --git a/src/plugins/gtpu/gtpu_encap.c b/src/plugins/gtpu/gtpu_encap.c index 5c37f4db306..4442c42ad66 100644 --- a/src/plugins/gtpu/gtpu_encap.c +++ b/src/plugins/gtpu/gtpu_encap.c @@ -298,19 +298,23 @@ gtpu_encap_inline (vlib_main_t * vm, /* Fix GTPU length */ gtpu0 = (gtpu_header_t *)(udp0+1); new_l0 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b0) - - sizeof (*ip4_0) - sizeof(*udp0)); + - sizeof (*ip4_0) - sizeof(*udp0) + - GTPU_V1_HDR_LEN); gtpu0->length = new_l0; gtpu1 = (gtpu_header_t *)(udp1+1); new_l1 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b1) - - sizeof (*ip4_1) - sizeof(*udp1)); + - sizeof (*ip4_1) - sizeof(*udp1) + - GTPU_V1_HDR_LEN); gtpu1->length = new_l1; gtpu2 = (gtpu_header_t *)(udp2+1); new_l2 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b2) - - sizeof (*ip4_2) - sizeof(*udp2)); + - sizeof (*ip4_2) - sizeof(*udp2) + - GTPU_V1_HDR_LEN); gtpu2->length = new_l2; gtpu3 = (gtpu_header_t *)(udp3+1); new_l3 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b3) - - sizeof (*ip4_3) - sizeof(*udp3)); + - sizeof (*ip4_3) - sizeof(*udp3) + - GTPU_V1_HDR_LEN); gtpu3->length = new_l3; } else /* ipv6 */ @@ -397,19 +401,23 @@ gtpu_encap_inline (vlib_main_t * vm, /* Fix GTPU length */ gtpu0 = (gtpu_header_t *)(udp0+1); new_l0 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b0) - - sizeof (*ip4_0) - sizeof(*udp0)); + - sizeof (*ip6_0) - sizeof(*udp0) + - GTPU_V1_HDR_LEN); gtpu0->length = new_l0; gtpu1 = (gtpu_header_t *)(udp1+1); new_l1 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b1) - - sizeof (*ip4_1) - sizeof(*udp1)); + - sizeof (*ip6_1) - sizeof(*udp1) + - GTPU_V1_HDR_LEN); gtpu1->length = new_l1; gtpu2 = (gtpu_header_t *)(udp2+1); new_l2 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b2) - - sizeof (*ip4_2) - sizeof(*udp2)); + - sizeof (*ip6_2) - sizeof(*udp2) + - GTPU_V1_HDR_LEN); gtpu2->length = new_l2; gtpu3 = (gtpu_header_t *)(udp3+1); new_l3 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b3) - - sizeof (*ip4_3) - sizeof(*udp3)); + - sizeof (*ip6_3) - sizeof(*udp3) + - GTPU_V1_HDR_LEN); gtpu3->length = new_l3; } @@ -556,7 +564,8 @@ gtpu_encap_inline (vlib_main_t * vm, /* Fix GTPU length */ gtpu0 = (gtpu_header_t *)(udp0+1); new_l0 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b0) - - sizeof (*ip4_0) - sizeof(*udp0)); + - sizeof (*ip4_0) - sizeof(*udp0) + - GTPU_V1_HDR_LEN); gtpu0->length = new_l0; } @@ -592,7 +601,8 @@ gtpu_encap_inline (vlib_main_t * vm, /* Fix GTPU length */ gtpu0 = (gtpu_header_t *)(udp0+1); new_l0 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b0) - - sizeof (*ip4_0) - sizeof(*udp0)); + - sizeof (*ip4_0) - sizeof(*udp0) + - GTPU_V1_HDR_LEN); gtpu0->length = new_l0; }