From: sf Date: Fri, 26 Jul 2024 06:29:01 +0000 (+0000) Subject: vio: Don't request csum offload if not negotiated X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2175e0d6ddd57e1fbfe4eaa5bc2282b4b4b632db;p=openbsd vio: Don't request csum offload if not negotiated The standard says "A driver MUST NOT enable an offload for which the appropriate feature has not been negotiated." ok jan@ --- diff --git a/sys/dev/pv/if_vio.c b/sys/dev/pv/if_vio.c index 5ff0ccac697..19f276cfbcf 100644 --- a/sys/dev/pv/if_vio.c +++ b/sys/dev/pv/if_vio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vio.c,v 1.42 2024/06/28 14:46:31 jan Exp $ */ +/* $OpenBSD: if_vio.c,v 1.43 2024/07/26 06:29:01 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -731,7 +731,8 @@ vio_init(struct ifnet *ifp) if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS)) { uint64_t features = 0; - SET(features, VIRTIO_NET_F_GUEST_CSUM); + if (virtio_has_feature(vsc, VIRTIO_NET_F_GUEST_CSUM)) + SET(features, VIRTIO_NET_F_GUEST_CSUM); if (ISSET(ifp->if_xflags, IFXF_LRO)) { if (virtio_has_feature(vsc, VIRTIO_NET_F_GUEST_TSO4))