From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 28 23:30:16 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3F5A16A410 for ; Wed, 28 Jun 2006 23:30:16 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46C23454BF for ; Wed, 28 Jun 2006 23:30:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k5SNUGxj011636 for ; Wed, 28 Jun 2006 23:30:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k5SNUFVr011635; Wed, 28 Jun 2006 23:30:16 GMT (envelope-from gnats) Resent-Date: Wed, 28 Jun 2006 23:30:16 GMT Resent-Message-Id: <200606282330.k5SNUFVr011635@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Craig Leres Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6EA6516A40F for ; Wed, 28 Jun 2006 23:26:37 +0000 (UTC) (envelope-from leres@ee.lbl.gov) Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.1.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26B65454B9 for ; Wed, 28 Jun 2006 23:26:37 +0000 (GMT) (envelope-from leres@ee.lbl.gov) Received: from fun.ee.lbl.gov (localhost [127.0.0.1]) by fun.ee.lbl.gov (8.13.7/8.13.7) with ESMTP id k5SNQbN8047536 for ; Wed, 28 Jun 2006 16:26:37 -0700 (PDT) Received: from fun.ee.lbl.gov (leres@localhost) by fun.ee.lbl.gov (8.13.7/8.13.7/Submit) with ESMTP id k5SNQbkw047533 for ; Wed, 28 Jun 2006 16:26:37 -0700 (PDT) Message-Id: <200606282326.k5SNQbkw047533@fun.ee.lbl.gov> Date: Wed, 28 Jun 2006 16:26:37 -0700 From: Craig Leres To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: conf/99595: [PATCH] /etc/rc.d/dhclient doesn't interact well with the ports isc dhcp client X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2006 23:30:17 -0000 >Number: 99595 >Category: conf >Synopsis: [PATCH] /etc/rc.d/dhclient doesn't interact well with the ports isc dhcp client >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 28 23:30:15 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Craig Leres >Release: FreeBSD 6.1-RELEASE i386 >Organization: Lawrence Berkeley National Laboratory >Environment: fox 15 % uname -a FreeBSD fox.ee.lbl.gov 6.1-RELEASE FreeBSD 6.1-RELEASE #3: Tue Jun 20 11:50:33 PDT 2006 leres@fox.ee.lbl.gov:/usr/src/6.1-RELEASE/sys/i386/compile/LBLSMP i386 fox 16 % pkg_info | grep isc-dhcp3-client isc-dhcp3-client-3.0.4 The ISC Dynamic Host Configuration Protocol client >Description: The test in /etc/rc.d/dhclient that is supposed to prevent dhclient from being launched if one is already running doesn't work with the ports version of dhclient. If you have an interface configured for dhcp in /etc/rc.conf, dhclient runs and gets a lease normally but then is run again later at which point it sets the interface address to 0.0.0.0, ending network access via that NIC. >How-To-Repeat: Install the isc-dhcp3-client and configure a NIC to use it: ifconfig_em0="dhcp" Then reboot. The interface will come up when dhclient runs. Later when it's run again, you'll see this message: Internet Systems Consortium DHCP Client V3.0.3 Copyright 2004-2005 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/products/DHCP Listening on BPF/em0/00:30:48:00:00:01 Sending on BPF/em0/00:30:48:00:00:01 Can't bind to dhcp address: Address already in use Please make sure there is no other dhcp server running and that there's no entry for dhcp or bootp in /etc/inetd.conf. Also make sure you are not running HP JetAdmin software, which includes a bootp server. At this point the original dhclient is still running but the interface is misconfigured and you're hosed. >Fix: The simplest solution is to check /var/run/dhclient.pid in addition doing the pgrep test that's already in the rc script. The appended patch implements this. A more complete solution would be to also change the base version of dhclient to manage the /var/run/dhclient.pid file and remove the pgrep test from the rc.d script. (If there is interest in that, I'd be happy to generate the diffs.) ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="a.txt"; charset="us-ascii" Content-ID: <47530.1151537075.2@fun.ee.lbl.gov> *** dhclient 2006/06/14 18:16:09 1.1 --- dhclient 2006/06/14 18:16:19 *************** *** 18,28 **** --- 18,40 ---- dhclient_start() { + local f rc_flags pid pids + # prevent unnecessicary restarts # XXX: should use a pidfile if [ -x /usr/bin/pgrep ]; then pids=`/usr/bin/pgrep -f "dhclient: $ifn(\$| .*)"` if [ -n "$pids" ]; then + exit 0 + fi + fi + + # deal with isc dhclient too + f="/var/run/dhclient.pid" + if [ -s ${f} ]; then + pid="`cat ${f}`" + kill -0 "${pid}" >/dev/null 2>&1 + if [ $? -eq 0 ]; then exit 0 fi fi ------- =_aaaaaaaaaa0-- >Release-Note: >Audit-Trail: >Unformatted: ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <47530.1151537075.1@fun.ee.lbl.gov>