From 2175e0d6ddd57e1fbfe4eaa5bc2282b4b4b632db Mon Sep 17 00:00:00 2001 From: sf Date: Fri, 26 Jul 2024 06:29:01 +0000 Subject: [PATCH] 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@ --- sys/dev/pv/if_vio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)) -- 2.20.1