git: af33f86e6aef - main - carp: don't unintentionally revert to multicast mode

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Fri, 24 Jan 2025 10:25:01 UTC
The branch main has been updated by kp:

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

commit af33f86e6aef6b15c8aa3da615167272aa7a3ee3
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-01-21 09:49:55 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-01-24 10:20:30 +0000

    carp: don't unintentionally revert to multicast mode
    
    PR:             284140
    MFC after:      2 weeks
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/ifconfig/carp.c      | 4 ----
 tests/sys/netinet/carp.sh | 7 +++++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c
index 36b5d85ab7b8..7c7398f92d48 100644
--- a/sbin/ifconfig/carp.c
+++ b/sbin/ifconfig/carp.c
@@ -292,10 +292,6 @@ static struct afswtch af_carp = {
 static __constructor void
 carp_ctor(void)
 {
-	/* Default to multicast. */
-	setcarp_mcast(NULL, NULL, 0);
-	setcarp_mcast6(NULL, NULL, 0);
-
 	for (size_t i = 0; i < nitems(carp_cmds);  i++)
 		cmd_register(&carp_cmds[i]);
 	af_register(&af_carp);
diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh
index 39cfad14907c..f9e47c70f492 100755
--- a/tests/sys/netinet/carp.sh
+++ b/tests/sys/netinet/carp.sh
@@ -202,8 +202,11 @@ unicast_v4_body()
 	atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \
 	    ping -c 3 192.0.2.1
 
-	jexec carp_uni_v4_two ifconfig
-	jexec carp_uni_v4_three ifconfig
+	# Check that we remain in unicast when tweaking settings
+	atf_check -s exit:0 -o ignore \
+	    jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2
+	atf_check -s exit:0 -o match:"peer 198.51.100.130" \
+	    jexec carp_uni_v4_two ifconfig ${epair_one}b
 }
 
 unicast_v4_cleanup()