Skip to content

Commit

Permalink
fix encap udp packet size mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdunstan committed May 20, 2024
1 parent 775b244 commit b0aa27c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bpf/pfc_tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b0aa27c

Please sign in to comment.