From 22ce0a1bf04c1b28c77d4abb7d089c3260d686be Mon Sep 17 00:00:00 2001 From: Yang Li Date: Thu, 17 Oct 2024 16:52:48 +0800 Subject: [PATCH] If sourceIP is antrea-gw0/fl4096, use standard vxlan --- tc_prog/tc_prog_kern.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tc_prog/tc_prog_kern.c b/tc_prog/tc_prog_kern.c index 12004ed..8e0f223 100644 --- a/tc_prog/tc_prog_kern.c +++ b/tc_prog/tc_prog_kern.c @@ -273,6 +273,13 @@ int tc_init_in_func(struct __sk_buff *ctx) { if (eth->h_proto != bpf_htons(ETH_P_IP)) goto out; struct iphdr *iphdr = (struct iphdr *)(eth + 1); + unsigned int src_ip = iphdr->saddr; + src_ip = ntohl(src_ip); + unsigned int last_octet = src_ip & 0xFF; + if (last_octet == 1 || last_octet == 0) { + goto out; + } + // We only learn the flow that is marked as 0x4 if ((iphdr->tos & 0xc) != 0xc) goto out; ///////////////////////// Header/ifidx Learning ////////////////////