From owner-freebsd-wireless@FreeBSD.ORG Fri Nov 1 19:16:46 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3A432EEC for ; Fri, 1 Nov 2013 19:16:46 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6F432224 for ; Fri, 1 Nov 2013 19:16:45 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id q58so4420278wes.0 for ; Fri, 01 Nov 2013 12:16:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=n56IYnfHRBAPbhtn+C+6nh3wHZyDlFpqbPgDpCWo9j0=; b=ivU0I0Fq418PMWRiSoKwccrEIQVm0/3XqOjz7V9i01iohZH/KZD7kvQvC1bCJd/Nck 4cd+zY+QKDarY6kyLdqcaPAyVPBL7nHcgrB5PznmhBxZapn81pwj5ikBs+NNWmiJMJyC LrX4RvNy9zFltZQG9N5ga5i1J48uvoxE/r4kEllzRdiOABltDNGfNLprctsN/f2Ia+KT xYRETAvu+XOCO3kwbnkkxCN9SAT8Uua705OO4GJU2B0GNG/YM/02ZyoY84UGIP9TWpk2 Pb4RKpx9OUcLfBuZTip3VgOzW5Ee4Kij60EevyMeLAZIhO1q5DZJI6hezJuejQ9kPWwE foAw== X-Gm-Message-State: ALoCoQl1g4GIpQkbhDskuPx2cwNimWY+VIn2DZC0YRaBqq2FDoUuP38Tr45IpQ1slUHwRg+I6QQx MIME-Version: 1.0 X-Received: by 10.180.12.14 with SMTP id u14mr3364913wib.63.1383333397831; Fri, 01 Nov 2013 12:16:37 -0700 (PDT) Received: by 10.227.226.196 with HTTP; Fri, 1 Nov 2013 12:16:37 -0700 (PDT) X-Originating-IP: [88.65.59.108] In-Reply-To: <1383331203.12614.1.camel@eva02.mbsd> References: <1382572583.1862.39.camel@eva02.mbsd> <1382589020.1846.36.camel@eva02.mbsd> <1383331203.12614.1.camel@eva02.mbsd> Date: Fri, 1 Nov 2013 20:16:37 +0100 Message-ID: Subject: Re: service netif restart [iface] runs a wpa_supplicant twice From: Bernhard Schmidt To: clutton Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-wireless@freebsd.org 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 19:16:46 -0000 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_supplicant >> > 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.o= rg" > > 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? 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. 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? 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 Bernhard