Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Apr 2009 06:44:43 +0400 (MSD)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/133987: [rc.d] defaultroute broken with DHCP in some cases
Message-ID:  <20090425024443.0EE10108841@hades.panopticon>
Resent-Message-ID: <200904250250.n3P2o2TU024782@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090425024443.0EE10108841>