Fix GTP-U header in 4x IPv4 vector encapsulation 09/13509/2
authorAndreas Schultz <andreas.schultz@travelping.com>
Tue, 17 Jul 2018 09:10:16 +0000 (11:10 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Wed, 18 Jul 2018 01:39:15 +0000 (01:39 +0000)
The fourth GTP-U packet had a wrong reference, leading to data
corruption.

Change-Id: Id82f87368183d5e8b7047133c5ea799f2a9cb43c
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
src/plugins/gtpu/gtpu_encap.c

index 8ad53c5..5c37f4d 100644 (file)
@@ -308,7 +308,7 @@ gtpu_encap_inline (vlib_main_t * vm,
              new_l2 = clib_host_to_net_u16 (vlib_buffer_length_in_chain(vm, b2)
                                             - sizeof (*ip4_2) - sizeof(*udp2));
              gtpu2->length = new_l2;
-             gtpu3 = (gtpu_header_t *)(udp1+3);
+             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));
              gtpu3->length = new_l3;