From owner-freebsd-wireless@FreeBSD.ORG Fri Nov 1 20:15:57 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E40F45E1 for ; Fri, 1 Nov 2013 20:15:57 +0000 (UTC) (envelope-from clutton@zoho.com) Received: from sender1.zohomail.com (sender1.zohomail.com [72.5.230.95]) by mx1.freebsd.org (Postfix) with ESMTP id C50BB25B8 for ; Fri, 1 Nov 2013 20:15:57 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version; b=rJ2F7wLh4gKwPX2r8hCp/qt8+4gkpba7VRhhICpcW8fGhHjySTNq8GWV2F8EimumYuXe554qKZ7k +GI7mRGp2+pPCReh+EGuWFKX3fg7NbivldsdC39bJuWh2WCU3qbd Received: from [192.168.11.5] (213.111.120.236 [213.111.120.236]) by mx.zohomail.com with SMTPS id 1383336955742413.66200506551456; Fri, 1 Nov 2013 13:15:55 -0700 (PDT) Subject: Re: service netif restart [iface] runs a wpa_supplicant twice From: clutton To: freebsd-wireless@freebsd.org In-Reply-To: References: <1382572583.1862.39.camel@eva02.mbsd> <1382589020.1846.36.camel@eva02.mbsd> <1383331203.12614.1.camel@eva02.mbsd> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-IXDXDJG/3oyLC+sS0HM3" Date: Fri, 01 Nov 2013 22:15:45 +0200 Message-ID: <1383336945.13657.34.camel@eva02.mbsd> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-Zoho-Virus-Status: 1 X-ZohoMail: Ss SS_10 UW UB UW UB SGR3_1_25103_83 X-ZohoMail-Owner: <1383336945.13657.34.camel@eva02.mbsd>+zmo_0_ X-ZohoMail-Sender: 213.111.120.236 X-ZohoMailClient: External X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Nov 2013 20:15:58 -0000 --=-IXDXDJG/3oyLC+sS0HM3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2013-11-01 at 20:16 +0100, Bernhard Schmidt wrote: > On Fri, Nov 1, 2013 at 7:40 PM, clutton wrote: > > On Wed, 2013-10-23 at 21:43 -0700, Adrian Chadd wrote: > >> IT's not. It's devd doing something dumb. > >> > >> > >> -a > >> > >> > >> On 23 October 2013 21:30, clutton wrote: > >> > >> > Indeed. > >> > > >> > I have looked at a sys/net80211 and at a sys/dev/ath. > >> > But I still have no idea which one triggers rc script and how on the > >> > earth it can be done. > >> > > >> > On Wed, 2013-10-23 at 16:57 -0700, Adrian Chadd wrote: > >> > > . that needs to be fixed. It definitely shouldn't be started twice= ! > >> > > > >> > > > >> > > > >> > > -adrian > >> > > > >> > > > >> > > > >> > > On 23 October 2013 16:56, clutton wrote: > >> > > > >> > > > What is the best way to restart a wireless stack? > >> > > > > >> > > > A command "ifconfig wlan0 create wlandev ath0" starts the > >> > wpa_supplicant > >> > > > by itself. It means that the netif script runs the wpa_supplican= t > >> > twice, > >> > > > always. Is it ok? > >> > > > > >> > > > There is my debug during booting: > >> > > > > >> > > > [netif.network_common()] START: > >> > > > [netif.network_common()] ITERATION: > >> > > > [wpa_supplicant] SUPPID=3D30067 > >> > > > [wpa_supplicant] SUPPID=3D30067 > >> > > > [netif.network_common()] STOP: > >> > > > > >> > > > It means that during running a network_common() from the > >> > /etc/rc.d/netif > >> > > > the /etc/rc.d/wpa_supplicant was called twice. > >> > > > > >> > > > /etc/rc.conf > >> > > > wlans_ath0=3D"wlan0" > >> > > > ifconfig_wlan0=3D"WPA DHCP" > >> > > > ifconfig_em0=3D"DHCP" > >> > > > ipsec_enable=3D"YES" > >> > > > > >> > > > /etc/wpa_supplicant.conf > >> > > > network=3D{ > >> > > > ssid=3D"ssid" > >> > > > psk=3D"psk" > >> > > > } > >> > > > > >> > > > 11.0-CURRENT > >> > > > > >> > > _______________________________________________ > >> > > freebsd-wireless@freebsd.org mailing list > >> > > http://lists.freebsd.org/mailman/listinfo/freebsd-wireless > >> > > To unsubscribe, send any mail to " > >> > freebsd-wireless-unsubscribe@freebsd.org" > >> > > >> > > >> _______________________________________________ > >> freebsd-wireless@freebsd.org mailing list > >> http://lists.freebsd.org/mailman/listinfo/freebsd-wireless > >> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd= .org" > > > > Yes, it's not a bug, just misconfigured devd. > > Here the patch: > > > > =CE=9E ~ =E2=86=92 diff -u /usr/src/etc/devd.conf /etc/devd.conf > > --- /usr/src/etc/devd.conf 2013-09-29 17:24:16.759250174 +0300 > > +++ /etc/devd.conf 2013-11-01 10:52:02.731746832 +0200 > > @@ -38,7 +38,7 @@ > > # > > notify 0 { > > match "system" "IFNET"; > > - match "subsystem" "!usbus[0-9]+"; > > + match "subsystem" "!(usbus|wlan)[0-9]+"; > > match "type" "ATTACH"; > > action "/etc/pccard_ether $subsystem start"; > > }; > > zsh: exit 1 diff -u /usr/src/etc/devd.conf /etc/devd.conf > > =E2=86=911 ~ =E2=86=92 > > > > Is it good enough? Should I make an pr? > > I believe that the wlan iface may be avoided and all cases, am I wrong? >=20 > That actually is a design question I once wrapped my head around > unsuccessfully. The lines above are responsible for configuring wlan0 > if it is created, eg. > ifconfig wlan0 destroy > ifconfig wlan0 create wlandev ath0 > will invoke above code which will then invoke pccard_ether. Changing > the code as you intent to will prevent this. >=20 > Someone should step up an decide what is supposed to happen, should > wlan0 in that case be configured as stated in rc.conf, or not? >=20 > The actual issue though, is in wpa_supplicant itself. It has code to > prevent it being started twice, but that doesn't kick in because the > instances are started to fast and we loose (have not yet setup enough) > information in our net code. >=20 > --=20 > Bernhard At least it shouldn't call the pccard_ether. My wifi card is not the pccard nor the ether card :). Here we have an old design + a new implementation of wlan devices. And yes, it occurs that the FreeBSD has some kind of a NetworkManager. In my view it should be optional, because rc.d scripts is mandatory anyway. --=-IXDXDJG/3oyLC+sS0HM3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAABAgAGBQJSdAvxAAoJECNkWbjnbjui7bcP/i5w1gPqrNuhOOk7/RL/9jGa 4JscmLcMp4AzrgQEj7B+Nt0WzV2a5L8e0LxupmalKgk9Zn9y6EDQeaYx2hLiKWqg nMTqT03V8G1Rl206XCg9DQeW1Lg7JYnJ1QGOQxSIJyBH1jDOZRayE4n5mbw0ehnT nGDrVD4+kOpO7B3WHHJxV+CqiXEfCpN6q6CI0jGnFI10ntsVgg66weud5rLpq+eY gzLQoDs0bNR6l3Mlf2ksDYTwmcCYXeGarz6YUuZoT3GfXEnL+/IktiXvAZMnFqOy 79MCR3WpE75QP6JBT+0OIeZKHdSeSMik99RtgtvRDR+Fgdo7dXwj2d5V3gtJ2Bh0 mfhX9ures+i7yM8Wu4tAmMGer3tCFHRhlJXBzp9dvnRgu8LwVFuDQLmpzUKSGzMo ep7G5+3o5YzPQHzPsX+sJLunkcxNV0EqWshjHPz96vszLolhHxjyqnSoZOPvUC5q eU/aCs2JhO1FAKLP7Xa/NkgOTqKqoHR6imbJOI+dSblhhIYmYEMXKKtu8XPA2GEs aqVRbPMgWubsqdwKIJgNqj4QagDNRE0AgSYXw1wxYNQPZQR7ZQOwVcUhlJiKdzAc jXNGaTpCmJgWjBuCmQiMjqvmNxByEBdYMK0hzndsu6nd9TVEs87MHmbn9ENrGgyJ gWY5wNVAEF3ahjcXuoqM =Z8SO -----END PGP SIGNATURE----- --=-IXDXDJG/3oyLC+sS0HM3--