Bug 191415

Summary: [carp] CARP password with "-" causes /etc/rc.d/netif to infinite loop
Product: Base System Reporter: Vick Khera <vivek>
Component: confAssignee: Hiroki Sato <hrs>
Status: Closed FIXED    
Severity: Affects Some People CC: citrin+pr, hrs, rc
Priority: Normal    
Version: 10.0-RELEASE   
Hardware: Any   
OS: Any   

Description Vick Khera 2014-06-26 16:54:49 UTC
I just upgraded a system from freebsd 9.1 to 10.0-p6. It is a member of a CARP
cluster, so I updated the configuration as follows:

 ifconfig_em0_alias0="inet 192.168.97.97/23 vhid 205 advskew 100 pass aaa-bbb"

in my /etc/rc.conf file. Previously, it was on a cloned interface carp0. The
em0 interface also has its own IP address for the machine.

On reboot, the machine 'hangs' running /etc/rc.d/netif. Booting into single
user and commenting out that one line lets it boot, albeit without the
necessary CARP address activated.

I played around with it, and I discovered that if I remove the "-" in the
password, the netif script completes.

However, it still does not apply the CARP address alias, but this PR is about
the infinite loop, and likely I'm doing something wrong to set the address.

Environment:
System: FreeBSD redfish.kcilink.com 10.0-RELEASE-p6 FreeBSD 10.0-RELEASE-p6 #2 r267868: Wed Jun 25 09:49:14 EDT 2014 vivek@lorax.kcilink.com:/u/lorax1/usr10/obj/u/lorax1/usr10/src/sys/KCI64 amd64

How-To-Repeat:
add an alias similar to the one above, then run

sh -x /etc/rc.d/netif restart

to watch it go into an infinite loop.

Fix:
Do not use "-" in the CARP password of an ifconfig alias in /etc/rc.conf
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-07-08 02:06:41 UTC
Over to -net; notify -rc.
Comment 2 Hiroki Sato freebsd_committer freebsd_triage 2014-11-03 01:26:05 UTC
Take.
Comment 3 Hiroki Sato freebsd_committer freebsd_triage 2014-11-04 00:37:34 UTC
This issue was fixed in r272858 on stable/10.  For 10.0-R you can apply a change of r272858 or replace /etc/network.subr with the latest version.
Comment 4 Anton Yuzhaninov 2015-11-12 12:02:14 UTC
I use FreeBSD 10 with this fix (r290229) but still my server hang on /etc/rc.d/netif restart if "-" used in carp password.

top from console show high CPU usage by sh /etc/rc.d/netif - seems to be infinite loop somewhere.

ifconfig_vlan301_alias5="vhid 140 advskew 50 pass foo01-bar_abc 192.0.2.140/24" # infinite loop

ifconfig_vlan301_alias5="vhid 140 advskew 50 pass foo01_abc 192.0.2.140/24" # works