From dc7b55648ddcd4c2c5cc5631415b10d279ad5f58 Mon Sep 17 00:00:00 2001 From: Eric Long Date: Fri, 27 Sep 2024 22:06:08 +0800 Subject: [PATCH] bpf/ingress: remove XXX of restore_data Now that we can insert padding, we can insert and TCP timestamp options in all packets some time later. --- bpf/ingress.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bpf/ingress.c b/bpf/ingress.c index 4b2b5de..1a18954 100644 --- a/bpf/ingress.c +++ b/bpf/ingress.c @@ -10,11 +10,7 @@ // Move back n bytes, shrink socket buffer and restore data. // -// XXX: Not handling TCP options appended by middleboxes. This requires `bpf_xdp_adjust_head` and -// `memmove`ing bytes from the start of the buffer to destination port, which is expensive when -// applied to every data packet. For the same reason, middleboxes probably only append options like -// MSS on handshake packets since there is no data at the end to move, so not finishing this is -// probably going to be fine. +// XXX: Not handling TCP options appended by middleboxes static inline int restore_data(struct xdp_md* xdp, __u16 offset, __u32 buf_len, __be32* csum_diff, __u8 padding_len) { size_t reserve_len = TCP_UDP_HEADER_DIFF + padding_len;