From nobody Tue Sep 15 02:04:31 2026 X-Original-To: dev-commits-src-all@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 4hkQLl59Nxz6sMVq for ; Tue, 15 Sep 2026 02:04:31 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hkQLl3Mbmz4Zpw for ; Tue, 15 Sep 2026 02:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789437871; 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=rMdPE8x0cWMmsIx/u4pjzJJFjXL1MGt150TmtMD26nk=; b=gSa/t4cTUwiSgZfB1/VB7JRUCHaCPUyaV2eRR5j2uV31eAGuEgnqKFK4WCsLRoUL/t6Daq 0dBHeuWCWBbPZGDJFY32V7OS3AeswceQmmv9xVRPfBgW93ZdSD5qL8e5laZ6uBEOLp1ffh ORUTw7efX7HhJF3/kV7Wbs9pKUv+77b+USV/YtWrHmAY0Sn9alhbfMYfsAiv0ZY7FFe9bp qSG0jKtoRKkeIAA5pepGpyMPdf3k2mi6wgFgsXRoX7qFPKQBgOLhnpo+gYNcyNUBD5NqyN CEsgTq2qYEhd/ED7qlH7K29S/QcPfqUkKqLGz/9x4MPl8Ibqv5KnCO1isBR6fA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789437871; b=qDmTvgM205wEdfJx6vgNWxc/0PjzrFDAfpc3XqVFBmoGAbi+L/R/AYpNwUel0LQoiZl2IC rY5KJeb5WYqzD4FsvYl00OJUgOdKUm0OmFSace4PtSbehBHCU+uwCj6aGg+4XyA4IEKLg6 2wEp0iZXgQzp0OFPUO4Yzpu8po0jC8bK8jTqUbCXaDerqePjVXzQw5xZtfZmt6EJS1Y6h3 jPjbtfeGD2Pgk5tvuIqVNLJi5B2h0w1SkG3Fd6DyA6zOasG2kcXww69CDfAuILWcCwzngS By1bY94Hiw4sSRLfkfs/JQhRAZLZttnkF9r9NwvLFTKgk2NQRfJfNkrFaxYPgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789437871; 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=rMdPE8x0cWMmsIx/u4pjzJJFjXL1MGt150TmtMD26nk=; b=ljcm/tnJT6nH5iPI2VUsOluj0z/2tyE3UB02paR332r+sQ4obCogQsq9lAun7kdVxK1Q9P FgJYXliR8At5A8bcRiezqI9PewWMVz+vpo2Uwr3joHGMfc0mN82GAfHNLYPbv6iF7DMvOq x08g6sDLlm/C0wW84pS4/+sRkCTDCBLQ6GaAtOck40jOHWVIfPmUVeNoiqgAgB0mO8neCT rLnEIDhCfOmMOeyS0IgOSEk+iKULvVr354Sf4yyCcXHnIB2adLGIqzQCVp1Am6Y/TL7jog gdqjVxculoyr0nXIw8EAEMOUb8j6pHr8gpdWqigKcxAVov4EiD/RyraXLt1EOA== 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 4hkQLl2QmWzgXn for ; Tue, 15 Sep 2026 02:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23d5a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 15 Sep 2026 02:04:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: b5519c449337 - main - hyperv: Configure IPv6 when setting up VF failover List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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/main X-Git-Reftype: branch X-Git-Commit: b5519c449337fea1d5cbaf2f0ba11cafa36338ee Auto-Submitted: auto-generated Date: Tue, 15 Sep 2026 02:04:31 +0000 Message-Id: <6aa8a7af.23d5a.38624f6a@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=b5519c449337fea1d5cbaf2f0ba11cafa36338ee commit b5519c449337fea1d5cbaf2f0ba11cafa36338ee Author: Kevin Bowling AuthorDate: 2026-09-15 01:48:25 +0000 Commit: Kevin Bowling CommitDate: 2026-09-15 02:03:24 +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.") MFC after: 2 weeks Sponsored by: BBOX.io --- 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.