bin/133987: [rc.d] defaultroute broken with DHCP in some cases

Dmitry Marakasov amdmi3 at FreeBSD.org
Sat Apr 25 02:50:03 UTC 2009


>Number:         133987
>Category:       bin
>Synopsis:       [rc.d] defaultroute broken with DHCP in some cases
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 25 02:50:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Apr 25 04:57:52 MSD 2009 root at hades.panopticon:/async/obj/usr/src/sys/HADES i386


>Description:
There's problem when using DHCP at least with ale(4) interface: unless using synchronous_dhclient="YES", interface won't get IP address at all on boot -> the box will end up without default route and with most of network services failing to start.

The cause of this is the check at the start of defaultroute_start (/etc/rc.d/defaultroute): it will only wait for default route if there's DHCP-configured interface with carrier. ale, however, usually happens to be DOWN by the time defaultroute is executed -> no wait for default route -> broken boot.

Here's the boot log for the case when synchronous_dhclient="YES" is used. Note interface being DOWN by the time rc is executed, and going UP couple of seconds after.

---
ale0: <Atheros AR8121/AR8113/AR8114 PCIe Ethernet> port 0xdc00-0xdc7f mem 0xfe9c0000-0xfe9fffff irq 17 at device 0.0 on pci2
ale0: 960 Tx FIFO, 1024 Rx FIFO
ale0: Using 1 MSI messages.
miibus0: <MII bus> on ale0
atphy0: <Atheros F1 10/100/1000 PHY> PHY 0 on miibus0
atphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto
ale0: Ethernet address: 00:22:15:75:15:b2
ale0: [FILTER]
... (many other devices)
ale0: changing name to 'panopticon'
panopticon: link state changed to DOWN
panopticon: no link .....panopticon: link state changed to UP
 got link
DHCPREQUEST on panopticon to 255.255.255.255 port 67
DHCPREQUEST on panopticon to 255.255.255.255 port 67
DHCPACK from 192.168.0.2
bound to 192.168.0.32 -- renewal in 43200 seconds.
---

>How-To-Repeat:
Boot with single ale(4) interface configured with DHCP.
>Fix:
The solution is probably to remove check for carrier in defaultroute_start() at all. That'll lead to extra 30 second wait for the people booting with no net access at all, but will ensure correct boot for others.
brooks@ has even better idea: http://www.mail-archive.com/svn-src-all@freebsd.org/msg08127.html
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list