vio(4): Don't set IPv4 checksum OK flag for rx packets.
authorjan <jan@openbsd.org>
Fri, 16 Aug 2024 13:02:44 +0000 (13:02 +0000)
committerjan <jan@openbsd.org>
Fri, 16 Aug 2024 13:02:44 +0000 (13:02 +0000)
The virtio specification just address TCP/UDP checksum offloading.
Thus, we have to check the IPv4 checksum in our stack.

ok sf@

sys/dev/pv/if_vio.c

index e6168ca..4901314 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_vio.c,v 1.45 2024/08/01 11:13:19 sf Exp $  */
+/*     $OpenBSD: if_vio.c,v 1.46 2024/08/16 13:02:44 jan Exp $ */
 
 /*
  * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
@@ -1133,9 +1133,6 @@ vio_rx_offload(struct mbuf *m, struct virtio_net_hdr *hdr)
 
        ether_extract_headers(m, &ext);
 
-       if (ext.ip4)
-               SET(m->m_pkthdr.csum_flags, M_IPV4_CSUM_IN_OK);
-
        if (ext.tcp) {
                SET(m->m_pkthdr.csum_flags, M_TCP_CSUM_IN_OK);
                if (ISSET(hdr->flags, VIRTIO_NET_HDR_F_NEEDS_CSUM))