From a1f89082dcb591886acc22c5503a2d5a82b267d9 Mon Sep 17 00:00:00 2001 From: Mark Peek Date: Wed, 13 Mar 2024 16:53:07 -0700 Subject: [PATCH] hyperv/hn: Don't return error when setting media to autoselect Setting media to autoselect would always return EOPNOTSUPP. As autoselect is the only valid media, this change now returns success instead. PR: 264253 Reported by: Prakash Shiva Reviewed by: Dexuan Cui , whu Approved by: whu MFC after: 2 weeks (cherry picked from commit 63a7c4be4ad524629292eee659d6542f1c5e9c21) --- sys/dev/hyperv/netvsc/if_hn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 6e1c9771a02..41be4226e59 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -1103,7 +1103,8 @@ static int hn_ifmedia_upd(if_t ifp __unused) { - return EOPNOTSUPP; + /* Ignore since autoselect is the only defined and valid media */ + return (0); } static void