Re: sk0 and dhclient

From: Jens Rehsack <rehsack_at_liwing.de>
Date: Fri, 19 Dec 2003 09:17:09 +0000
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

--- etc/rc.d/dhclient.orig	Wed Aug  6 18:10:42 2003
+++ etc/rc.d/dhclient	Thu Jul 31 19:02:10 2003
_at__at_ -1,4 +1,4 _at__at_
-#!/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 $
_at__at_ -69,11 +69,26 _at__at_
 
 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()
Received on Fri Dec 19 2003 - 00:17:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:34 UTC