From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 9 10:10:12 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3598B106566B for ; Thu, 9 Jun 2011 10:10:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8FE8FC1A for ; Thu, 9 Jun 2011 10:10:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p59AABXL061859 for ; Thu, 9 Jun 2011 10:10:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p59AABou061858; Thu, 9 Jun 2011 10:10:11 GMT (envelope-from gnats) Resent-Date: Thu, 9 Jun 2011 10:10:11 GMT Resent-Message-Id: <201106091010.p59AABou061858@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, Nick Hibma Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439D8106566C for ; Thu, 9 Jun 2011 10:08:36 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from cpsmtpb-ews05.kpnxchange.com (cpsmtpb-ews05.kpnxchange.com [213.75.39.8]) by mx1.freebsd.org (Postfix) with ESMTP id C22CB8FC19 for ; Thu, 9 Jun 2011 10:08:35 +0000 (UTC) Received: from cpbrm-ews31.kpnxchange.com ([10.94.84.162]) by cpsmtpb-ews05.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 9 Jun 2011 11:56:31 +0200 Received: from CPSMTPM-CMT105.kpnxchange.com ([195.121.3.21]) by cpbrm-ews31.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 9 Jun 2011 11:56:30 +0200 Received: from uitsmijter.van-laarhoven.org ([81.207.207.222]) by CPSMTPM-CMT105.kpnxchange.com with Microsoft SMTPSVC(7.0.6002.18264); Thu, 9 Jun 2011 11:55:59 +0200 Received: by uitsmijter.van-laarhoven.org (Postfix, from userid 1001) id AD8DFAC815; Thu, 9 Jun 2011 11:55:59 +0200 (CEST) Message-Id: <20110609095559.AD8DFAC815@uitsmijter.van-laarhoven.org> Date: Thu, 9 Jun 2011 11:55:59 +0200 (CEST) From: Nick Hibma To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/157725: devd does not stop dhclient on removing cable from vr ethernet port 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: Thu, 09 Jun 2011 10:10:12 -0000 >Number: 157725 >Category: kern >Synopsis: devd does not stop dhclient on removing cable from vr ethernet port >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jun 09 10:10:11 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Nick Hibma >Release: FreeBSD 8.2-STABLE i386 >Organization: AnyWi Technologies >Environment: FreeBSD AWSniffer 8.0-STABLE FreeBSD 8.0-STABLE #2: Tue Feb 22 13:49:20 CET 2011 root@billary.localdomain:/usr/obj/nanobsd.8/usr/src/sys/SOEKRIS8 i386 >Description: In /etc/devd.conf it says: # Try to start dhclient on Ethernet like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually # run it. No link down rule exists because dhclient automaticly exits # when the link goes down. but this is not true. dhclient does not exit. >How-To-Repeat: On a SOEKRIS board (hm, they use vr chips now as well ...): # ifconfig vr2 vr2: flags=8843 metric 0 mtu 1500 options=8280b ether 00:00:24:cd:95:2a inet 192.168.1.92 netmask 0xffffff00 broadcast 192.168.1.255 inet 172.17.17.17 netmask 0xfffffff0 broadcast 172.17.17.31 media: Ethernet autoselect (100baseTX ) status: active # ps ax|grep dhclient 1661 ?? Ss 0:00.00 dhclient: vr2 [priv] (dhclient) 1679 ?? Ss 0:00.00 dhclient: vr2 (dhclient) # ifconfig vr2 vr2: flags=8843 metric 0 mtu 1500 options=8280b ether 00:00:24:cd:95:2a inet 192.168.1.92 netmask 0xffffff00 broadcast 192.168.1.255 inet 172.17.17.17 netmask 0xfffffff0 broadcast 172.17.17.31 media: Ethernet autoselect (none) status: no carrier # ps ax | grep dhclient 1661 ?? Ss 0:00.00 dhclient: vr2 [priv] (dhclient) 1679 ?? Ss 0:00.00 dhclient: vr2 (dhclient) On an ALIX board: # ifconfig vr0 vr0: flags=8843 metric 0 mtu 1500 options=8280b ether 00:0d:b9:1b:57:28 inet 192.168.1.94 netmask 0xffffff00 broadcast 192.168.1.255 inet 192.168.1.2 netmask 0xfffffffc broadcast 192.168.1.3 media: Ethernet autoselect (100baseTX ) status: active # ps ax|grep dhclient 3633 ?? Ss 0:00.00 dhclient: vr0 [priv] (dhclient) 3652 ?? Ss 0:00.00 dhclient: vr0 (dhclient) # ifconfig vr0 vr0: flags=8843 metric 0 mtu 1500 options=8280b ether 00:0d:b9:1b:57:28 inet 192.168.1.94 netmask 0xffffff00 broadcast 192.168.1.255 inet 192.168.1.2 netmask 0xfffffffc broadcast 192.168.1.3 media: Ethernet autoselect (none) status: no carrier # ps ax | grep dhclient 3633 ?? Is 0:00.00 dhclient: vr0 [priv] (dhclient) 3652 ?? Ss 0:00.00 dhclient: vr0 (dhclient) >Fix: Adding the following additional configuration fixes this: notify 10 { match "system" "IFNET"; match "type" "LINK_DOWN"; media-type "ethernet"; action "/etc/rc.d/dhclient quietstop $subsystem"; }; Notes: - I have not tested this with other priority values. - I have not tested this in a setup with interfaces with no DHCP in their config lines. Output of devd and console: Processing event '!system=IFNET subsystem=vr2 type=LINK_DOWN' Pushing table setting system=IFNET setting subsystem=vr2 setting type=LINK_DOWN Processing notify event Testing system=IFNET against ^IFNET Testing type=LINK_DOWN against ^LINK_UP Testing system=IFNET against ^IFNET Testing type=LINK_DOWN against ^LINK_DOWN Testing media type of vr2 against 0x20 vr2 has media type 0x20 Executing '/etc/rc.d/dhclient quietstop vr2' Jun 1 12:13:12 AWSniffer dhclient[1661]: connection closed Jun 1 12:13:12 AWSniffer dhclient[1661]: exiting. Popping table >Release-Note: >Audit-Trail: >Unformatted: