Skip to content

Commit

Permalink
xdp-synproxy: drop IP_DF check
Browse files Browse the repository at this point in the history
When XDP synproxy receives tcp packet that
does not have IP DF flag set, tcp packet is
dropped. Not all website has IP DF set for
each tcp packet, do drop IP_DF check.

fix: vincentmli/BPFire#59

Signed-off-by: Vincent Li <[email protected]>
  • Loading branch information
vincentmli committed Oct 25, 2024
1 parent 37024e2 commit e2a03b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xdp-synproxy/xdp_synproxy.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static __always_inline int tcp_lookup(void *ctx, struct header_pointers *hdr, bo
/* TCP doesn't normally use fragments, and XDP can't reassemble
* them.
*/
if ((hdr->ipv4->frag_off & bpf_htons(IP_DF | IP_MF | IP_OFFSET)) != bpf_htons(IP_DF))
if ((hdr->ipv4->frag_off & bpf_htons(IP_MF | IP_OFFSET)) != 0)
return XDP_DROP;

tup.ipv4.saddr = hdr->ipv4->saddr;
Expand Down

0 comments on commit e2a03b1

Please sign in to comment.