From afd37e221cb97cabda9ba2edda3308ba50e4b3f9 Mon Sep 17 00:00:00 2001 From: Yang Li Date: Sat, 8 Feb 2025 15:04:08 +0800 Subject: [PATCH] Send FIN packet to vxlan tunnel, make sure conntrack not established in host --- tc_prog/common_kern.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tc_prog/common_kern.h b/tc_prog/common_kern.h index e62feae..07cded8 100644 --- a/tc_prog/common_kern.h +++ b/tc_prog/common_kern.h @@ -26,6 +26,9 @@ int parse_5tuple_in(struct iphdr * iph, void *data_end, struct fivetuple* tuple) tuple->protocol = iph->protocol; if (proto == IPPROTO_TCP) { struct tcphdr *tcphdr = (struct tcphdr *)(iph + 1); + if (tcphdr->fin) { + return 1; + } tuple->rport = tcphdr->source; tuple->lport = tcphdr->dest; } else if (proto == IPPROTO_UDP) { @@ -50,6 +53,9 @@ int parse_5tuple_e(struct iphdr * iph, void *data_end, struct fivetuple* tuple) tuple->protocol = iph->protocol; if (proto == IPPROTO_TCP) { struct tcphdr *tcphdr = (struct tcphdr *)(iph + 1); + if (tcphdr->fin) { + return 1; + } tuple->lport = tcphdr->source; tuple->rport = tcphdr->dest; } else if (proto == IPPROTO_UDP) {