Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Mar 2002 18:37:36 +0100
From:      David Gullasch <xonox@web.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/36170: an(4) does an_init() even if interface is down
Message-ID:  <20020321183736.A22647@idefix.methyltheobro.mine.nu>

next in thread | raw e-mail | index | archive | help

>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 <xonox@web.de>
>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<BROADCAST,SIMPLEX,MULTICAST> 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<BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020321183736.A22647>