From owner-freebsd-current@FreeBSD.ORG Wed Nov 18 22:55:57 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C6AB1065670 for ; Wed, 18 Nov 2009 22:55:57 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f204.google.com (mail-qy0-f204.google.com [209.85.221.204]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF678FC13 for ; Wed, 18 Nov 2009 22:55:57 +0000 (UTC) Received: by qyk42 with SMTP id 42so941086qyk.28 for ; Wed, 18 Nov 2009 14:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=STdA1DMjDr+wMWn5Sgey9jDhU1b9wohNDW/+CQsZX7o=; b=wUYk4AIlZf8/ICjt4C3Ze+TnbD54fagcQ1iEVNelrFgbo0/kEQeI0rr5B8HwoRv033 lH0ZhJcImZfXkmWPZ/x5bOHg21E4JU3HdeAZHMMXdkldPKr5dnm81gWZIo8xznKqTe8L Trrb/LENY/0cHh8lQuIQhTXk7L2dB0kMuzaGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=QoXKgY7Paz3P9md/eO48sVhf2aLzhLqxCXD0aE8dgOdk846y9WK41yaEhU9cbrQPF8 6+TUHTCcC8hFkBqXtdBx3l/ef3Dxkvhhp27txFoHyhgPrYxBo0unG65FZkXvI+QrlPnA Vg2OCAmXjD0w+uTwB9XJthEX6hsLTJHEnUbMk= Received: by 10.224.88.93 with SMTP id z29mr6783675qal.54.1258584951199; Wed, 18 Nov 2009 14:55:51 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 7sm789792qwb.2.2009.11.18.14.55.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 18 Nov 2009 14:55:49 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 18 Nov 2009 14:55:21 -0800 From: Pyun YongHyeon Date: Wed, 18 Nov 2009 14:55:21 -0800 To: Warren Block Message-ID: <20091118225521.GO1262@michelle.cdnetworks.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Pk6IbRAofICFmK5e" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: current@freebsd.org Subject: Re: sendmail aliases/Realtek 8111 problem (bin/139870) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2009 22:55:57 -0000 --Pk6IbRAofICFmK5e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 17, 2009 at 07:55:43PM -0700, Warren Block wrote: > sendmail was ignoring existing aliases on startup. This is apparently > due to a network interface not being ready in time in combination with a > not-FQDN hostname. > > With a hostname of "lightning" (no domain), re0 configured by DHCP, and > verbose sendmail logging: > > 050 WARNING: interface re0 is UP with 0.0.0.0 address > 050 WARNING: local host name (lightning) is not qualified; see cf/README: > WHO AM I > > A restart of sendmail after startup works normally because re0 has > acquired an address by then. Entering a FQDN as hostname > (hostname="lightning.wonkity.com") in rc.conf works also. > > I would say that this is really a problem with re0 and not with sendmail > startup, but don't really know. > > re0 does a DOWN/UP three times on startup. > I'm not sure but this can happen on all systems that have to use DHCP. The problem I can see here is unnecessary re(4) interface reinitialization triggered by dhclient even if it can avoid most of them. Would you try attached patch? It may reduce the number of interface UP/DOWNs during getting an IP address via DHCP. I haven't tested the patch though, I no longer have access to re(4) hardwares. > re0: 8168/8168B/8168C/8168CP/8168D/8168DP/8111B/8111C/8111CP/8111DP PCIe Gigabit > Ethernet> port 0xe800-0xe8ff mem > 0xfdfff000-0xfdffffff,0xfdfe0000-0xfdfeffff irq 17 at device 0.0 on pci4 > > re0@pci0:4:0:0: class=0x020000 card=0x514c1462 chip=0x816810ec > rev=0x02 hdr=0x00 > vendor = 'Realtek Semiconductor' > device = 'Gigabit Ethernet NIC(NDIS 6.0) (RTL8168/8111)' > class = network > subclass = ethernet > > -Warren Block * Rapid City, South Dakota USA --Pk6IbRAofICFmK5e Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.init.patch" Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 199490) +++ sys/dev/re/if_re.c (working copy) @@ -753,6 +753,7 @@ ifp->if_flags |= IFF_PROMISC; sc->rl_testmode = 1; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); sc->rl_flags |= RL_FLAG_LINK; if (sc->rl_type == RL_8169) @@ -2145,8 +2146,10 @@ * XXX check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); + } } return (rx_npkts); } @@ -2222,8 +2225,10 @@ RL_ISR_TX_ERR|RL_ISR_TX_DESC_UNAVAIL)) re_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); + } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2539,6 +2544,9 @@ mii = device_get_softc(sc->rl_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel pending I/O and free all RX/TX buffers. */ @@ -2793,7 +2801,8 @@ case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - re_set_rxmode(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + re_set_rxmode(sc); RL_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2862,8 +2871,10 @@ if ((mask & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; } - if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) + if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init(sc); + } VLAN_CAPABILITIES(ifp); } break; @@ -2899,6 +2910,7 @@ ifp->if_oerrors++; re_rxeof(sc, NULL); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -3011,15 +3023,16 @@ CSR_READ_1(sc, RL_GPIO) | 0x01); } - /* reinitialize interface if necessary */ - if (ifp->if_flags & IFF_UP) - re_init_locked(sc); - /* * Clear WOL matching such that normal Rx filtering * wouldn't interfere with WOL patterns. */ re_clrwol(sc); + + /* reinitialize interface if necessary */ + if (ifp->if_flags & IFF_UP) + re_init_locked(sc); + sc->suspended = 0; RL_UNLOCK(sc); --Pk6IbRAofICFmK5e--