From b0aa27cffdd0ab8159c440292c8f615cb6e2ae7a Mon Sep 17 00:00:00 2001 From: oz_adam Date: Mon, 20 May 2024 18:49:56 -0400 Subject: [PATCH] fix encap udp packet size mismatch --- src/bpf/pfc_tc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bpf/pfc_tc.h b/src/bpf/pfc_tc.h index 9212108..bfb3a04 100644 --- a/src/bpf/pfc_tc.h +++ b/src/bpf/pfc_tc.h @@ -454,7 +454,7 @@ int gue_encap_v4(struct __sk_buff *skb, struct tunnel *tun, struct service *svc) set_ipv4_csum((void *)&h_outer.ip); // fill UDP - int len = bpf_ntohs(iph_inner.tot_len) + sizeof(h_outer.udp) + sizeof(h_outer.gue) + 20 /*sizeof(h_outer.gueext*/; + int len = bpf_ntohs(iph_inner.tot_len) + sizeof(h_outer.udp) + sizeof(h_outer.gue) + 4 /*sizeof(h_outer.gueext*/; h_outer.udp.dest = tun->port_remote; h_outer.udp.source = tun->port_local; h_outer.udp.len = bpf_htons(len);