diff --git a/src/xdpfw_kern.c b/src/xdpfw_kern.c index a44e1aa..66859a8 100644 --- a/src/xdpfw_kern.c +++ b/src/xdpfw_kern.c @@ -86,7 +86,7 @@ int xdp_prog_main(struct xdp_md *ctx) struct ethhdr *eth = data; // Check if the ethernet header is valid. - if (eth + 1 > (struct ethhdr *)data_end) + if (unlikely(eth + 1 > (struct ethhdr *)data_end)) { return XDP_DROP; }