Skip to content

Commit

Permalink
drop ipv4 fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
pengjianzhang committed May 26, 2022
1 parent fe6ec24 commit d76deb4
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 d76deb4

Please sign in to comment.