aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-11-05 20:21:42 -0700
committerFlorin Coras <florin.coras@gmail.com>2021-11-06 03:20:43 +0000
commitbc1640a5044e8b7a06c3cc6d41543198b81e610c (patch)
treee5a739827749e94c2ad1c7989b8cddfd85caaf7c /src/vnet/tcp
parent2e3a79ff50dbb853059aee8c48610e3610f9c66f (diff)
tcp: in place tcp header for buffer resets
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2a5de36175bca1181ffd4a1865d41f0a1f6bc035
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp_output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index cfdd1da9188..db42029e7b3 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -613,11 +613,11 @@ tcp_buffer_make_reset (vlib_main_t *vm, vlib_buffer_t *b, u8 is_ip4)
/* Zero all flags but free list index and trace flag */
b->flags &= VLIB_BUFFER_NEXT_PRESENT - 1;
- b->current_data = 0;
+ /* Make sure new tcp header comes after current ip */
+ b->current_data = ((u8 *) th - b->data) + sizeof (tcp_header_t);
b->current_length = 0;
b->total_length_not_including_first_buffer = 0;
vnet_buffer (b)->tcp.flags = 0;
- vlib_buffer_make_headroom (b, TRANSPORT_MAX_HDRS_LEN);
/*
* Add TCP and IP headers