Bug 14098

Summary: routing problem on DHCP client with network_interfaces="auto"
Product: Base System Reporter: amorita <amorita>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   

Description amorita 1999-10-03 05:00:01 UTC
Using Ethernet device intialized DHCP
and network_interfaces="auto" configuration,
ping to IP address of Ethernet device configured by DHCP is faild.

In my machine, ifconfig -l gives "fxp0 lp0 tun0 lo0"

Configuration Case 1:
network_interfaces="lo0 fxp0" # conventional case
ifconfig_fxp0="DHCP"

Configuration Case 2:
network_interfaces="fxp0 lo0" # same as "auto "case
ifconfig_fxp0="DHCP"

netstat -rn results
--- case 1 ---
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            xxx.y.zz.254       UGSc        2        3     fxp0
127.0.0.1          127.0.0.1          UH          1     5843      lo0
xxx.y.zz/23        link#1             UC          0        0     fxp0
xxx.y.zz.106       127.0.0.1          UGHS        0        0      lo0
xxx.y.zz.254       0:0:4c:a2:15:bc    UHLW        3        0     fxp0    566
--- case 1 ---

--- case 2 ---
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            xxx.y.zz.254       UGSc        0        0     fxp0
127.0.0.1          127.0.0.1          UH          0        0      lo0
xxx.y.zz/23        link#1             UC          0        0     fxp0
xxx.y.zz.106       127.0.0.1          UGHS        0        0     fxp0
xxx.y.zz.254       link#1             UHLW        1        0     fxp0
--- case 2 ---
, where xxx.y.zz.106 is IP address of fxp0 and xxx.y.zzz.254 is gateway.

In the case 2(same as network_interfaces="auto"),
ping xxx.y.zz.106 faild because of
--- dmesg ---
arplookup 127.0.0.1 failed: could not allocate llinfo
arpresolve: can't allocate llinfo for 127.0.0.1rt
--- dmesg ---

Fix: 

Initializing lo0 before other Ethernet device
configured by DHCP is essential.

I thought two way of fix.
one is /etc/rc.network initializing lo0 first.
the other is that /sbin/ifconfig -l gives lo0 as the first component
of the NIC list.
How-To-Repeat: In the case, you have fxp0 and use lo0 for loopback
and fxp0 configured by DHCP.

set /etc/rc.conf as following
network_interfaces="auto" (default value of /etc/defaults/rc.conf)
ifconfig_fxp0="DHCP"
and reboot in the network with DHCP Server.
Then ping to IP address of fxp0 interface.

I found this problem in the Note PC installed 3.3-RC
by DHCP configuration first.
And I tested 3.3-STABLE kernel build Sep 18,1999
with 3.3-RELESE userland.
Comment 1 David E. O'Brien freebsd_committer freebsd_triage 1999-12-12 01:45:04 UTC
State Changed
From-To: open->closed

fix committed and MFC'ed.