Bug 190818

Summary: /etc/rc.d/netif enters an endless cycle when ipv6 aliases are configured
Product: Base System Reporter: emz
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Works As Intended    
Severity: Affects Some People    
Priority: ---    
Version: 10.0-STABLE   
Hardware: Any   
OS: Any   

Description emz 2014-06-09 05:04:31 UTC
In a setup like this

ifconfig_vlan1="192.168.3.22/24 vlan 1 vlandev bce0"
ifconfig_vlan1_alias0="inet 192.168.3.13/32 vhid 5 advskew 50 pass XXXXXXXXXXXXXX"
ifconfig_vlan1_alias1="inet 192.168.3.1/32 vhid 5 advskew 50 pass XXXXXXXXXXXXXX"
ifconfig_vlan1_alias2="inet6 fd00::301 prefixlen 120 vhid 5 advskew 50 pass XXXXXXXXXXXXXX -accept_rtadv"
ifconfig_vlan15="192.168.7.7/24 vlan 15 vlandev bce0"
ifconfig_vlan15_alias0="inet 192.168.7.2/24"
ifconfig_vlan15_alias1="inet 192.168.7.6/24 vhid 7 advskew 50 pass XXXXXXXXXXXXXX"
ifconfig_vlan15_alias2="inet6 fd00::701 prefixlen 120 vhid 7 advskew 50 pass XXXXXXXXXXXXXX"
rtadvd_interfaces="vlan1 vlan15"
ifconfig_vlan1_ipv6="inet6 fd00::0316 prefixlen 120 -accept_rtadv"
ifconfig_vlan15_ipv6="inet6 fd00::0702 prefixlen 120 -accept_rtadv"

FreeBSD can never enter a multiuser because the startup process is stuck in an endless cycle. For some reason ifalias_expand_addr() is called with ipv6 arguments instead of ifalias_expand_addr_inet6.

May be carp has something to do with it.

In the video provided the server tried to boot with the config above, it enters the first endless cycle on first interface, after a while I hit Ctrl-C repeatedly, the booting process immediately enters the endless cycle in the second interface, after a bunch of Ctrl-C it finally boots up.

Link: http://unix.zhegan.in/files/output.mkv (about 8 megs, x264-encoded video from server's ipkvm).
Comment 1 emz 2014-06-09 12:17:19 UTC
Removing ipv6 aliases (leaving only primary addresses) resolves the issue.
Comment 2 emz 2014-06-09 12:35:59 UTC
Well... it took some time to figure that when -accept_rtadv is configured it alias instead of primary address, this breaks the network.subr, which uses '*-*' pattern for it's own purposes.

-accept_rtadv and also various mediaoptions should be configured with main addresses. This should be mentioned in BUGS sescion of rc.conf man page.