runtime: only check for hardware IP checksum for IP packets
@@ -165,11 +165,6 @@ static void net_rx_one(struct rx_net_hdr *hdr)
STAT(RX_PACKETS)++;
STAT(RX_BYTES) += mbuf_length(m);
- /* Did HW checksum verification pass? */
- if (hdr->csum_type != CHECKSUM_TYPE_UNNECESSARY)
- goto drop;
-
-
/*
* Link Layer Processing (OSI L2)
*/
@@ -201,6 +196,10 @@ static void net_rx_one(struct rx_net_hdr *hdr)
if (unlikely(!iphdr))
goto drop;
+ /* Did HW checksum verification pass? */
+ if (hdr->csum_type != CHECKSUM_TYPE_UNNECESSARY)
+ goto drop;
+
/* The NIC has validated IP checksum for us. */
if (unlikely(!ip_hdr_supported(iphdr)))
