summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAloys Augustin <aloaugus@cisco.com>2020-07-16 11:01:01 +0200
committerBenoƮt Ganne <bganne@cisco.com>2020-07-16 11:25:08 +0000
commitcf86740a11650231bab4d14bc8d9288a91a22f16 (patch)
tree7cb0529997c138e3467655029c22b69dfdbf63b0 /src
parent94dbf952204e811c5ec7a39600c25f7b40387f45 (diff)
gre: fix outer ip6 length
This updates the computation of the outer ip6 header payload_length field in order to take into account the GRE header length. Change-Id: Ie9f982521aeaef7279a9e329a33272d6fae0a428 Type: fix Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/gre/gre.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c
index db16fa979cc..83f12833611 100644
--- a/src/vnet/gre/gre.c
+++ b/src/vnet/gre/gre.c
@@ -339,7 +339,7 @@ gre46_fixup (vlib_main_t * vm,
* at the midchain node */
ip0->ip6.payload_length =
clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) -
- sizeof (*ip0));
+ sizeof (ip0->ip6));
tunnel_encap_fixup_4o6 (flags, (ip4_header_t *) (ip0 + 1), &ip0->ip6);
}
@@ -357,7 +357,7 @@ gre66_fixup (vlib_main_t * vm,
* at the midchain node */
ip0->ip6.payload_length =
clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) -
- sizeof (*ip0));
+ sizeof (ip0->ip6));
tunnel_encap_fixup_6o6 (flags, (ip6_header_t *) (ip0 + 1), &ip0->ip6);
}
@@ -365,15 +365,15 @@ static void
grex6_fixup (vlib_main_t * vm,
const ip_adjacency_t * adj, vlib_buffer_t * b0, const void *data)
{
- ip6_header_t *ip0;
+ ip6_and_gre_header_t *ip0;
ip0 = vlib_buffer_get_current (b0);
/* Fixup the payload length field in the GRE tunnel encap that was applied
* at the midchain node */
- ip0->payload_length =
+ ip0->ip6.payload_length =
clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) -
- sizeof (*ip0));
+ sizeof (ip0->ip6));
}
/**