Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: remove xdp_synproxy IP_DF check

In real world production websites, the IP_DF flag
is not always set for each packet from these websites.
the IP_DF flag check breaks Internet connection to
these websites for home based firewall like BPFire
when XDP synproxy program is attached to firewall
Internet facing side interface. see [0]

[0] https://github.com/vincentmli/BPFire/issues/59

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
Link: https://lore.kernel.org/r/20241025031952.1351150-1-vincent.mc.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>

authored by

Vincent Li and committed by
Martin KaFai Lau
0ab7cd1f 97e90539

+1 -2
+1 -2
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
··· 21 21 22 22 #define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3]) 23 23 24 - #define IP_DF 0x4000 25 24 #define IP_MF 0x2000 26 25 #define IP_OFFSET 0x1fff 27 26 ··· 441 442 /* TCP doesn't normally use fragments, and XDP can't reassemble 442 443 * them. 443 444 */ 444 - if ((hdr->ipv4->frag_off & bpf_htons(IP_DF | IP_MF | IP_OFFSET)) != bpf_htons(IP_DF)) 445 + if ((hdr->ipv4->frag_off & bpf_htons(IP_MF | IP_OFFSET)) != 0) 445 446 return XDP_DROP; 446 447 447 448 tup.ipv4.saddr = hdr->ipv4->saddr;