From bfe15f98179dcc697c5c676e71a936eb245522f6 Mon Sep 17 00:00:00 2001 From: r-caamano Date: Sat, 23 Dec 2023 03:39:13 +0000 Subject: [PATCH] added code to attempt stateful detection of path mtu based on internal tcp session initiation --- src/zfw_tc_ingress.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/zfw_tc_ingress.c b/src/zfw_tc_ingress.c index c946e61..1ac5ab9 100644 --- a/src/zfw_tc_ingress.c +++ b/src/zfw_tc_ingress.c @@ -744,17 +744,16 @@ int bpf_sk_splice(struct __sk_buff *skb){ sk = bpf_skc_lookup_tcp(skb, o_session, sizeof(o_session->ipv4),BPF_F_CURRENT_NETNS, 0); //bpf_printk("fragmentation needed srcip=%x, destip=%x, dport=%d", inner_iph->saddr, inner_iph->daddr, bpf_ntohs(o_session->ipv4.dport)); if(sk){ - /*if (sk->state != BPF_TCP_LISTEN){ + if (sk->state == BPF_TCP_LISTEN){ if(local_diag->verbose){ send_event(&event); } + bpf_printk("fragmentation needed srcip=%x, destip=%x, dport=%d", inner_iph->saddr, inner_iph->daddr, bpf_ntohs(o_session->ipv4.dport)); bpf_sk_release(sk); return TC_ACT_OK; - }*/ - bpf_printk("fragmentation needed srcip=%x, destip=%x, dport=%d", inner_iph->saddr, inner_iph->daddr, bpf_ntohs(o_session->ipv4.dport)); + } bpf_sk_release(sk); - return TC_ACT_OK; }else{ bpf_printk("not sK"); }