From owner-freebsd-current@FreeBSD.ORG Fri Dec 19 01:17:13 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0A8E16A4CE for ; Fri, 19 Dec 2003 01:17:13 -0800 (PST) Received: from mail.liwing.de (mail.liwing.de [213.70.188.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E2DE43D73 for ; Fri, 19 Dec 2003 01:17:11 -0800 (PST) (envelope-from rehsack@liwing.de) Received: (qmail 44527 invoked from network); 19 Dec 2003 09:17:09 -0000 Received: from stingray.liwing.de (HELO liwing.de) ([213.70.188.164]) (envelope-sender ) by mail.liwing.de (qmail-ldap-1.03) with SMTP for ; 19 Dec 2003 09:17:09 -0000 Message-ID: <3FE2C215.5070505@liwing.de> Date: Fri, 19 Dec 2003 09:17:09 +0000 From: Jens Rehsack User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031205 X-Accept-Language: de-de, de, en-us, en MIME-Version: 1.0 To: Marcus Larsson References: <20031213122314.GV13101@mindwipe.org> In-Reply-To: <20031213122314.GV13101@mindwipe.org> Content-Type: multipart/mixed; boundary="------------010101060005040609050203" cc: freebsd-current@freebsd.org Subject: Re: sk0 and dhclient X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2003 09:17:13 -0000 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: on skc0 > sk0: Ethernet address: 00:0c:6e:45:a7:b1 > miibus0: 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--