From nobody Thu Oct 29 05:02:36 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jFXCw575pz6xmXk for ; Thu, 29 Oct 2026 05:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFXCw48kTz4h3H for ; Thu, 29 Oct 2026 05:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793250156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sqtjc87yp4VcZer9kVBR8ByU2/xIdnaMIoc/xON4aQs=; b=leNUVNYK1DCBZ3cWMab6TES4XKc5lRPsn+Bu0MpCUQ77hTgSXfZt6UNQC3+vdwoNiYt54d s2+/vjdDk8GoLr0kX8GE+hltzKLf9X4VFSz8OcE1WAsERfgB76uQSiLkNiwp6Vd0vMrtXn OIMzOb61hdqoqdw+JR9i27+/v8hLJqz6LElbLnxOAWg5aMiWsi1kr4h14pVGDh1dtazRIF iFe5cKN1xbNfNeElLAdYii7/kbJY27Drzk9aFF8dyTH0/7X9K2LPqFQZPUtqmE5w+Xwfnp VsLuk6VcEWE/ZaLNG3ZBiMER5QBIEklytc95zLhsn6EdT08kQsCo/EOLl9Wo4A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793250156; b=QJFVyxEe3J1gOYX4xBsZusV9To/K3kiR0JMku6wdO1z9M+57G1kcAsg3r2k95IgossxxeN Lg6eGdvBOH8CAsuVQJ5Lm1qw7+O1ozT313Q5HjKxxGFGkvMAKgjxKs1sAGiHpU6thWrgGy g68ogeK5DaqHumTI/389nOFXXylsDtSOwiIBcwtSIsAkA6T17IC+cQZpg/p5PLaI2yQ5n6 7aA5a0ujO6gxV3LPmp/2adPXepytQpn5CFlDAmnfFTzoiH8lZn8+fxGfaFXq/+AGYKK4ro YRfF2PaeVeZ4pMo+LjhhSRcB/32BflLGTfPov2tJ71LHgVrih1Qjz04FRqojxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793250156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sqtjc87yp4VcZer9kVBR8ByU2/xIdnaMIoc/xON4aQs=; b=dbsnhx7x1cEscunpB6Im2TnPH6lgmZbkx5BbifjIeKmbIv2IQzih/wQ0SfUdLaCmMfaRAE SJigMrmhEB1OmcjfQfOkoIuzNmsZZcLNRF4EvD7//8EKFY/H+4r7QS3nFicaYe6Tuv0ZFp Ags68+KKFZynOcubmlH6VliKYbztVkOt2ZBuRQ2aukGp6XeYH99jFk2njQyWZ6h8KLmqee AhxV62/nRKivavIRhWtPPmUcroAxRfWEy/qzWox9BcAdl4W75fwp6DRZGnOS54KeTO5eyA uTZNWFF6gD5BfKgyUISbcdvZoOQR25vLh4o7t1nf+LpYIzlNTjnba/zKrkz6jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFXCw3q5CzPXt for ; Thu, 29 Oct 2026 05:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31af6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 05:02:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 88ad5d5f4e30 - stable/15 - hyperv: Configure IPv6 when setting up VF failover List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 88ad5d5f4e300176af520216c7ccdd83235c0ade Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 05:02:36 +0000 Message-Id: <6ae2d36c.31af6.6be79c5d@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=88ad5d5f4e300176af520216c7ccdd83235c0ade commit 88ad5d5f4e300176af520216c7ccdd83235c0ade Author: Kevin Bowling AuthorDate: 2026-09-15 01:48:25 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 05:02:27 +0000 hyperv: Configure IPv6 when setting up VF failover The default VF-up script moves IPv4 configuration from the synthetic interface to a failover lagg, but leaves IPv6 unconfigured on the lagg. Adding the synthetic interface as a member can remove its IPv6 addresses, so deleting the remaining member addresses is not sufficient. Stop accepting router advertisements on the synthetic interface before adding it to the lagg. Leave its link-local address and IPv6 enable state in place for lagg's address, prefix and default-router cleanup, then disable IPv6 and explicitly remove any remaining addresses. This also covers members without a link-local address or with IPv6 already disabled. Replay the synthetic interface's IPv6 rc.conf configuration on the lagg, including aliases, prefix-derived addresses and legacy configuration names. Remap the variables in a subshell and reuse network.subr's IPv6 helpers. For SLAAC, solicit fresh router advertisements rather than copying learned addresses as permanent ones. Configure IPv6 independently of the IPv4 DHCP/static choice, and leave existing laggs alone on repeated invocation. Custom DHCPv6 clients and interface-scoped static routes still require the per-interface setup hook. Fixes: c68595695679 ("hyperv: Add VF bringup scripts and devd rules.") Sponsored by: BBOX.io (cherry picked from commit b5519c449337fea1d5cbaf2f0ba11cafa36338ee) --- contrib/hyperv/tools/scripts/hyperv_vfup | 80 ++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/contrib/hyperv/tools/scripts/hyperv_vfup b/contrib/hyperv/tools/scripts/hyperv_vfup index e637c6c32e02..34689a08d201 100644 --- a/contrib/hyperv/tools/scripts/hyperv_vfup +++ b/contrib/hyperv/tools/scripts/hyperv_vfup @@ -5,6 +5,56 @@ load_rc_config netif +# Configure IPv6 on the lagg using the synthetic interface's rc.conf values. +# Keep the variable remapping local to this subshell. +ipv6_lagg_up() +( + local var value suffix ifconfig_args + + afexists inet6 || return 0 + if ! ipv6if $hn && ! checkyesno ipv6_activate_all_interfaces + then + return 0 + fi + + for var in `list_vars "ifconfig_${hn}_*"` + do + suffix=${var#ifconfig_${hn}_} + case $suffix in + ipv6|alias*) + eval value=\"\$$var\" + setvar "ifconfig_${lagg}_${suffix}" "$value" + ;; + esac + done + value=`get_if_var $hn ipv6_prefix_IF` + setvar "ipv6_prefix_${lagg}" "$value" + for var in `list_vars "ipv6_ifconfig_${hn}"` \ + `list_vars "ipv6_ifconfig_${hn}_alias*"` + do + suffix=${var#ipv6_ifconfig_${hn}} + eval value=\"\$$var\" + setvar "ipv6_ifconfig_${lagg}${suffix}" "$value" + done + ipv6_network_interfaces="$ipv6_network_interfaces $lagg" + + ifconfig $lagg inet6 -ifdisabled up || return 1 + for ifconfig_args in "`ifconfig_getargs $lagg ipv6`" \ + "`get_if_var $lagg ipv6_ifconfig_IF`" + do + [ -n "$ifconfig_args" ] || continue + # Accept legacy values without the address-family keyword. + case $ifconfig_args in + inet6|inet6[[:space:]]*) ;; + *) ifconfig_args="inet6 $ifconfig_args" ;; + esac + ifconfig $lagg $ifconfig_args || return 1 + done + ipv6_up $lagg + ipv6_accept_rtadv_up $lagg + return 0 +) + # # Customized per-interface setup, e.g. hyperv_vfup.hn1 # @@ -52,10 +102,31 @@ then fi # - # Configure laggX (failover), add hnX and VF to it. + # Stop accepting advertisements on hnX. Leave IPv6 enabled and its + # link-local address in place until lagg has purged the member's + # IPv6 addresses, prefixes, and default routers. # - ifconfig $lagg laggproto failover laggport $hn laggport $vf - ifconfig $lagg inet6 no_dad + if afexists inet6 + then + ifconfig $hn inet6 -accept_rtadv || exit 1 + fi + + # Configure laggX (failover), add hnX and VF to it. + ifconfig $lagg laggproto failover laggport $hn laggport $vf || exit 1 + if afexists inet6 + then + # lagg does not purge an IPv6-disabled member or one without a + # link-local address. Disable IPv6 and remove any addresses left. + # SLAAC addresses are relearned on lagg, not copied as permanent. + ifconfig $hn inet6 ifdisabled || exit 1 + inet6_status=`ifconfig $hn inet6` || exit 1 + for addr in `printf '%s\n' "$inet6_status" | \ + awk '$1 == "inet6" { print $2 }'` + do + ifconfig $hn inet6 "$addr" -alias || exit 1 + done + ifconfig $lagg inet6 no_dad + fi # # Stop dhclient on hnX, if any. @@ -74,8 +145,6 @@ then # Enumerate addresses; an empty ifconfig -alias may return success. ipv4_down $hn - # TODO: Remove IPv6 addresses on hnX - # # Use hnX's configuration for laggX # @@ -100,6 +169,7 @@ then ifconfig $lagg $ifconfig_args fi fi + ipv6_lagg_up || exit 1 else # # laggX exists. Check whether VF was there or not.