sk0 and dhclient

Jens Rehsack rehsack at liwing.de
Fri Dec 19 01:17:13 PST 2003


Marcus Larsson wrote:
>   
>   Hi *
> 
>   I have a 3com 940 ethernet card and I have ifconfig_sk0="DHCP"
>   in my rc.conf. When I boot my machine it hangs on dhclient but
>   after a certain amount of time dhclient gives up and the boot
>   process continues. When I login and run 'dhclient sk0' it
>   works without any hazzle but I can't get an IP addy during
>   bootup. Now is anyone else experiencing this?
> 
>   skc0: <3Com 3C940 Gigabit Ethernet> port 0xd400-0xd4ff mem 0xfeaf8000-0xfeafbfff irq 10 at device 5.0 on pci2
>   skc0: 3Com Gigabit LOM (3C940)
>   sk0: <Marvell Semiconductor, Inc. Yukon> on skc0
>   sk0: Ethernet address: 00:0c:6e:45:a7:b1
>   miibus0: <MII bus> on sk0

I've got similar problems, but with xl-cards, too. I solved it for
myself using attached patch. It's not the best solution, but under
those fixed circumstances it works fine.

Maybe this should be enhanced to be turned on by rc.conf-switch,
or limited to some interfaces...

Best regards,
Jens
-------------- next part --------------
--- etc/rc.d/dhclient.orig	Wed Aug  6 18:10:42 2003
+++ etc/rc.d/dhclient	Thu Jul 31 19:02:10 2003
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -x
 #
 # $NetBSD: dhclient,v 1.8 2002/03/22 04:33:58 thorpej Exp $
 # $FreeBSD: src/etc/rc.d/dhclient,v 1.9 2003/07/28 08:15:52 mbr Exp $
@@ -69,11 +69,26 @@
 
 dhclient_poststart()
 {
+	all_up=1
+	until [ $all_up -eq 0 ]
+	do
+		all_up=0
+		for ifn in ${_cooked_list}
+		do
+			if [ "0.0.0.0" = `ifconfig ${ifn} | grep "inet" | awk '{print $2;}'` ]
+			then
+				all_up=1
+				sleep 1
+			fi
+		done
+	done
+
 	for ifn in ${_cooked_list}; do
 		ifalias_up ${ifn}
 		ipx_up ${ifn}
 		ifconfig ${ifn}
 	done
+
 }
 
 dhclient_prestop()


More information about the freebsd-current mailing list