From owner-freebsd-bugs Thu Mar 21 9:40:23 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1EFCA37B41A for ; Thu, 21 Mar 2002 09:40:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2LHe1K88965; Thu, 21 Mar 2002 09:40:01 -0800 (PST) (envelope-from gnats) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by hub.freebsd.org (Postfix) with ESMTP id D65BF37B400 for ; Thu, 21 Mar 2002 09:37:40 -0800 (PST) Received: from fwd09.sul.t-online.de by mailout11.sul.t-online.com with smtp id 16o6VP-0007BR-0C; Thu, 21 Mar 2002 18:37:39 +0100 Received: from idefix.methyltheobro.mine.nu (520081541377-0001@[217.235.54.207]) by fmrl09.sul.t-online.com with esmtp id 16o6VN-1GkJLkC; Thu, 21 Mar 2002 18:37:37 +0100 Received: by idefix.methyltheobro.mine.nu (Postfix, from userid 1000) id 78330F01C; Thu, 21 Mar 2002 18:37:36 +0100 (CET) Message-Id: <20020321183736.A22647@idefix.methyltheobro.mine.nu> Date: Thu, 21 Mar 2002 18:37:36 +0100 From: David Gullasch To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/36170: an(4) does an_init() even if interface is down Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 36170 >Category: kern >Synopsis: an(4) does an_init() even if interface is down >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 Mar 21 09:40:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: David Gullasch >Release: FreeBSD 4.5-STABLE i386 >Organization: - >Environment: System: FreeBSD illuminatix.methyltheobro.mine.nu 4.5-STABLE FreeBSD 4.5-STABLE #12: Thu Mar 21 00:09:08 CET 2002 root@illuminatix.methyltheobro.mine.nu:/usr/obj/usr/src/sys/ILLUMINATIX i386 Hardware: Toshiba Satellite 3000-400 and Cisco Aironet AIR-PCM350 >Description: I am currently writing a wireless network auditing tool where i need to reconfigure my Aironet NIC while keeping it silent. This is not possible with the current an(4) because it will switch the NIC on via an_init() everytime when one does a SIOCSAIRONET. >How-To-Repeat: ,---- | # ifconfig an0 down | # ifconfig an0 | an0: flags=8802 mtu 1500 | ether 00:12:34:56:78:90 | media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps) | status: no carrier | ssid "" | stationname "" | channel 7 authmode OPEN powersavemode OFF powersavesleep 200 | wepmode OFF weptxkey 1 | wepkey 5:128-bit | # ancontrol -m 00:09:87:65:43:21 | # ifconfig an0 | an0: flags=8842 mtu 1500 | ether 00:09:87:65:43:21 | media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps) | status: no carrier | ssid "" | stationname "" | channel 7 authmode OPEN powersavemode OFF powersavesleep 200 | wepmode OFF weptxkey 1 | wepkey 5:128-bit `---- btw: it does not really make sense to have IFF_RUNNING=1 and IFF_UP=0 here because the SIOCSIFFLAGS semantics are that the driver shuts the interface down (IFF_RUNNING=0) when the user requests IFF_UP=0 and starts the interface (IFF_RUNNING=1) when the user requests IFF_UP=1. >Fix: Index: if_an.c =================================================================== RCS file: /usr/cvs/src/sys/dev/an/if_an.c,v retrieving revision 1.2.2.11 diff -u -r1.2.2.11 if_an.c --- if_an.c 18 Mar 2002 14:56:35 -0000 1.2.2.11 +++ if_an.c 21 Mar 2002 16:56:00 -0000 @@ -1212,7 +1212,7 @@ /* Reinitialize the card. */ - if (ifp->if_flags) + if (ifp->if_flags & IFF_RUNNING) an_init(sc); return; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message