Skip to content

Commit

Permalink
Merge pull request #125 from pengjianzhang/main
Browse files Browse the repository at this point in the history
drop ipv4 fragments
  • Loading branch information
pengjianzhang authored May 26, 2022
2 parents 9e012ee + d76deb4 commit 20cb958
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "lldp.h"
#include "kni.h"
#include "socket_timer.h"
#include <rte_ip_frag.h>

/* optimal value, don't change */
#define MBUF_PREFETCH_NUM 4
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 20cb958

Please sign in to comment.