1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-16 04:15:34 +02:00

tcp: Defer and coalesce all segments with no data (flags) to handler

...using pre-cooked buffers, just like we do with other segments.

While at it, remove some code duplication by having separate
functions for updating ACK sequence and window, and for filling in
buffer headers.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-05 19:46:59 +02:00
parent 371667fcfb
commit a4826ee04b
2 changed files with 377 additions and 142 deletions

1
tcp.h
View file

@ -14,6 +14,7 @@ int tcp_tap_handler(struct ctx *c, int af, void *addr,
struct tap_l4_msg *msg, int count, struct timespec *now);
int tcp_sock_init(struct ctx *c, struct timespec *now);
void tcp_timer(struct ctx *c, struct timespec *ts);
void tcp_defer_handler(struct ctx *c);
void tcp_update_l2_buf(unsigned char *eth_d, unsigned char *eth_s,
uint32_t *ip_da);
void tcp_remap_to_tap(in_port_t port, in_port_t delta);