Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2003 09:17:09 +0000
From:      Jens Rehsack <rehsack@liwing.de>
To:        Marcus Larsson <kore@mindwipe.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: sk0 and dhclient
Message-ID:  <3FE2C215.5070505@liwing.de>
In-Reply-To: <20031213122314.GV13101@mindwipe.org>
References:  <20031213122314.GV13101@mindwipe.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------010101060005040609050203
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

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

--------------010101060005040609050203
Content-Type: text/plain;
 name="patch-etc_rc.d_dhclient"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-etc_rc.d_dhclient"

--- 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()

--------------010101060005040609050203--



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