From d76deb49e0d6c94df6ac6546331ce149819fbd22 Mon Sep 17 00:00:00 2001 From: Jianzhang Peng Date: Thu, 26 May 2022 20:11:34 +0800 Subject: [PATCH] drop ipv4 fragments --- src/loop.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/loop.h b/src/loop.h index c9f2a9f9..1ec406f5 100644 --- a/src/loop.h +++ b/src/loop.h @@ -25,6 +25,7 @@ #include "lldp.h" #include "kni.h" #include "socket_timer.h" +#include /* optimal value, don't change */ #define MBUF_PREFETCH_NUM 4 @@ -120,7 +121,7 @@ static inline void ipv4_input(struct work_space *ws, struct rte_mbuf *m, iph = mbuf_ip_hdr(m); proto = iph->protocol; /* don't process ip options */ - if (unlikely(iph->ihl != 5)) { + if (unlikely((iph->ihl != 5) || rte_ipv4_frag_pkt_is_fragmented((const struct rte_ipv4_hdr *)iph))) { net_stats_rx_bad(); mbuf_free(m); return;