From: Florin Coras Date: Thu, 25 Sep 2025 17:52:21 +0000 (-0400) Subject: ip: frags should have as much space for headers as original X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=e95c1657798b5ad76a6c885b093df18a4f7e9754;p=vpp.git ip: frags should have as much space for headers as original Type: improvement Change-Id: Ic8ef26f588a7c161abbe63b3887a76faa32872de Signed-off-by: Florin Coras --- diff --git a/src/vnet/ip/ip_frag.c b/src/vnet/ip/ip_frag.c index aa7a031c909..adf49e93d4b 100644 --- a/src/vnet/ip/ip_frag.c +++ b/src/vnet/ip/ip_frag.c @@ -173,8 +173,9 @@ ip4_frag_do_fragment (vlib_main_t * vm, u32 from_bi, u16 mtu, vec_add1 (*buffer, to_bi); frag_set_sw_if_index (to_b, org_from_b); - /* Copy ip4 header */ - to_data = vlib_buffer_get_current (to_b); + /* Make sure we have as much space for headers as the original and copy + * ip4 header */ + to_data = vlib_buffer_make_headroom (to_b, org_from_b->current_data); clib_memcpy_fast (to_data, org_from_packet, head_bytes); to_ip4 = (ip4_header_t *) (to_data + l2unfragmentablesize); to_data = (void *) (to_ip4 + 1);