git: 1327d9102a5b - stable/15 - hyperv: Bound IPv4 address removal when configuring VF failover

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 05:02:22 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=1327d9102a5bdbf124095c5524382a6835f10036

commit 1327d9102a5bdbf124095c5524382a6835f10036
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-15 01:07:27 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 05:02:13 +0000

    hyperv: Bound IPv4 address removal when configuring VF failover
    
    The VF-up script repeatedly deletes the first IPv4 address from hn until
    ifconfig fails.  Netlink-based ifconfig returns success when no address
    remains, so the script can loop forever and block subsequent devd work.
    
    Use ipv4_down() from the already-sourced network.subr to enumerate the
    addresses and delete each explicitly.  This also handles multiple
    addresses without relying on the exit status of an empty deletion.  The
    behavior depends on ifconfig, not the VF hardware, so no device-specific
    fallback is needed.
    
    Fixes:  c68595695679 ("hyperv: Add VF bringup scripts and devd rules.")
    Sponsored by:   BBOX.io
    
    (cherry picked from commit 90f7956ff61f537def0d0aeb6ee03605a671d57e)
---
 contrib/hyperv/tools/scripts/hyperv_vfup | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/contrib/hyperv/tools/scripts/hyperv_vfup b/contrib/hyperv/tools/scripts/hyperv_vfup
index 7a2bc595c212..e637c6c32e02 100644
--- a/contrib/hyperv/tools/scripts/hyperv_vfup
+++ b/contrib/hyperv/tools/scripts/hyperv_vfup
@@ -71,14 +71,8 @@ then
 	# configured by dhclient.  laggX will take over the
 	# network operations.
 	#
-	while true
-	do
-		ifconfig $hn -alias > /dev/null 2>&1
-		if [ $? -ne 0 ]
-		then
-			break
-		fi
-	done
+	# Enumerate addresses; an empty ifconfig -alias may return success.
+	ipv4_down $hn
 
 	# TODO: Remove IPv6 addresses on hnX