diff --git a/xdp-synproxy/xdp_synproxy.bpf.c b/xdp-synproxy/xdp_synproxy.bpf.c index b5b08971..14dfa869 100644 --- a/xdp-synproxy/xdp_synproxy.bpf.c +++ b/xdp-synproxy/xdp_synproxy.bpf.c @@ -60,6 +60,7 @@ #define DEFAULT_WSCALE 7 #define DEFAULT_TTL 64 #define MAX_ALLOWED_PORTS 8 +#define MAX_WINDOW_SIZE 65535 #define MAX_PACKET_OFF 0xffff @@ -524,7 +525,7 @@ static __always_inline void tcp_gen_synack(struct tcphdr *tcp_header, swap(tcp_header->source, tcp_header->dest); tcp_header->ack_seq = bpf_htonl(bpf_ntohl(tcp_header->seq) + 1); tcp_header->seq = bpf_htonl(cookie); - tcp_header->window = 0; + tcp_header->window = bpf_htons(MAX_WINDOW_SIZE); tcp_header->urg_ptr = 0; tcp_header->check = 0; /* Calculate checksum later. */