Re: wlan can't discover known networks after relocating

2019-09-19 Thread Cy Schubert
On September 19, 2019 8:20:07 AM PDT, Adrian Chadd  
wrote:
>Roaming is done in wpa_supplicant when it's running.That's where the
>smarts
>need to be. :(
>
>
>
>-adrian
>
>
>On Thu, 19 Sep 2019 at 05:44, Bjoern A. Zeeb
>
>wrote:
>
>> On 19 Sep 2019, at 12:28, Tom Jones wrote:
>>
>> Hi,
>>
>> freebsd-wireless might be a better list for all this ..
>>
>>
>> > On Tue, Sep 17, 2019 at 04:36:28PM +, Poul-Henning Kamp wrote:
>> >> 
>> >> In message <707bcd3f-fa6b-82eb-fa8f-09c4b800f...@freebsd.org>,
>> >> Johannes Lundber
>> >> g writes:
>> >>
>> >>> For a long time now I have had this problem with iwm and wlan0.
>> >>> Whenever
>> >>> I move between work and home it won't reconnect automatically and
>I
>> >>> have
>> >>> to do wlan0 scan manually for it to pick up the different
>network.
>> >>
>> >> I suffer from the dreaded "reason=0" when I move inside my house:
>> >>
>> >>  > scan
>> >>  OK
>> >>  <3>CTRL-EVENT-SCAN-RESULTS
>> >>  <3>Trying to associate with 6c:3b:6b:3d:a2:e9
>(SSID='Palombia'
>> >> freq=2452 MHz)
>> >>  <3>CTRL-EVENT-DISCONNECTED bssid=6c:3b:6b:3d:a2:e9 reason=0
>> >>  <3>CTRL-EVENT-SCAN-RESULTS
>> >>  <3>Trying to associate with 6c:3b:6b:ab:ce:d4
>(SSID='Palombia'
>> >> freq=2412 MHz)
>> >>  <3>Associated with 6c:3b:6b:ab:ce:d4
>> >>
>> >> a2:e9 is the loudest AP here in my office, but my I have been in
>the
>> >> other end of the house iwn consistently fails to associate with it
>> >> and
>> >> and keeps picking the weaker AP in the far end.
>> >>
>> >> Eventually (hours!) it disconnects from the weaker ap, also with
>> >> "reason=0" and gets it right:
>> >>
>> >>  <3>WPA: Group rekeying completed with 6c:3b:6b:ab:ce:d4
>[GTK=CCMP]
>> >>  <3>CTRL-EVENT-DISCONNECTED bssid=6c:3b:6b:ab:ce:d4 reason=0
>> >>  <3>CTRL-EVENT-SCAN-RESULTS
>> >>  <3>Trying to associate with 6c:3b:6b:3d:a2:e9
>(SSID='Palombia'
>> >> freq=2452 MHz)
>> >>  <3>Associated with 6c:3b:6b:3d:a2:e9
>> >>  <3>WPA: Key negotiation completed with 6c:3b:6b:3d:a2:e9
>[PTK=CCMP
>> >> GTK=CCMP]
>> >>  <3>CTRL-EVENT-CONNECTED - Connection to 6c:3b:6b:3d:a2:e9
>> completed
>> >> [id=3 id_str=]
>> >>  <3>WPA: Group rekeying completed with 6c:3b:6b:3d:a2:e9
>[GTK=CCMP]
>> >>
>> >> And yes, working roaming would be nice too...
>> >
>> > I have the problem that when roaming networks become disabled
>> >
>> >   $ wpa_cli
>> >   Selected interface 'wlan0'
>> >
>> >   Interactive mode
>> >
>> >   > list_networks
>> >   network id / ssid / bssid / flags
>> >   0   network1any [CURRENT]
>> >   1   network2 any[DISABLED]
>> >   2   network3 any[DISABLED]
>> >   3   network4 any[DISABLED]
>> >   4   network5 any[DISABLED]
>> >   Selected interface 'wlan0'
>> >
>> >
>> > I address this by doing network_enable x in wpa_cli and it all
>comes
>> > back. I asked Adrian about this in the past, but it needs some
>> > debugging
>> > to pin down.
>>
>>
>> Is this iwm(4) as well in your case or another card?
>>
>> /bz
>> ___
>> freebsd-wireless@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
>> To unsubscribe, send any mail to
>"freebsd-wireless-unsubscr...@freebsd.org
>> "
>>
>___
>freebsd-curr...@freebsd.org mailing list
>https://lists.freebsd.org/mailman/listinfo/freebsd-current
>To unsubscribe, send any mail to
>"freebsd-current-unsubscr...@freebsd.org"

With wpa_supplicant running roaming is set to manual. Bgscan should be enabled. 
 

At home we have two n (and 2 g) wifi networks. When powering off one ap it 
connects to the other (in addition to using lagg to failover from ethernet to 
wifi and back).

Your wpa_supplicant should contain each ssid you intend to use. A wildcard can 
be used for open networks.

It's a while since I've tested this functionality but I can test again when I 
get home tonight. 


-- 
Pardon the typos and autocorrect, small keyboard in use.
Cheers,
Cy Schubert 
FreeBSD UNIX:  Web: http://www.FreeBSD.org

The need of the many outweighs the greed of the few.
___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"


Re: wlan can't discover known networks after relocating

2019-09-19 Thread Cy Schubert
In message <7938e5fa-67da-35fa-10d0-ee3004438...@freebsd.org>, Johannes 
Lundber
g writes:
> 
> On 9/19/19 3:06 PM, Adrian Chadd wrote:
> > So roaming in ifconfig/net80211 is what's set to manual.
> >
> > wpa_supplicant right now does RSSI threshold based roaming. All of the
> > roaming and network preferences when wpa_supplicant is running is done
> > in wpa_supplicant. That's where you have to look. Ideally
> > wpa_supplicant would be triggering bgscan too periodically rather than
> > only when the RSSI is low.
> >
> >
> >
> > -adrian
> >
> >
> > On Thu, 19 Sep 2019 at 15:04, Cy Schubert  > <mailto:cy.schub...@gmail.com>> wrote:
> >
> > On September 19, 2019 8:20:07 AM PDT, Adrian Chadd
> > mailto:adrian.ch...@gmail.com>> wrote:
> > >Roaming is done in wpa_supplicant when it's running.That's where the
> > >smarts
> > >need to be. :(
> > >
> > >
> > >
> > >-adrian
> > >
> > >
> > >On Thu, 19 Sep 2019 at 05:44, Bjoern A. Zeeb
> > > > <mailto:bzeeb-li...@lists.zabbadoz.net>>
> > >wrote:
> > >
> > >> On 19 Sep 2019, at 12:28, Tom Jones wrote:
> > >>
> > >> Hi,
> > >>
> > >> freebsd-wireless might be a better list for all this ..
> > >>
> > >>
> > >> > On Tue, Sep 17, 2019 at 04:36:28PM +, Poul-Henning Kamp
> > wrote:
> > >> >> 
> > >> >> In message <707bcd3f-fa6b-82eb-fa8f-09c4b800f...@freebsd.org>,
> > >> >> Johannes Lundber
> > >> >> g writes:
> > >> >>
> > >> >>> For a long time now I have had this problem with iwm and wlan0.
> > >> >>> Whenever
> > >> >>> I move between work and home it won't reconnect
> > automatically and
> > >I
> > >> >>> have
> > >> >>> to do wlan0 scan manually for it to pick up the different
> > >network.
> > >> >>
> > >> >> I suffer from the dreaded "reason=0" when I move inside my
> > house:
> > >> >>
> > >> >>      > scan
> > >> >>      OK
> > >> >>      <3>CTRL-EVENT-SCAN-RESULTS
> > >> >>      <3>Trying to associate with 6c:3b:6b:3d:a2:e9
> > >(SSID='Palombia'
> > >> >> freq=2452 MHz)
> > >> >>      <3>CTRL-EVENT-DISCONNECTED bssid=6c:3b:6b:3d:a2:e9 reason
> =0
> > >> >>      <3>CTRL-EVENT-SCAN-RESULTS
> > >> >>      <3>Trying to associate with 6c:3b:6b:ab:ce:d4
> > >(SSID='Palombia'
> > >> >> freq=2412 MHz)
> > >> >>      <3>Associated with 6c:3b:6b:ab:ce:d4
> > >> >>
> > >> >> a2:e9 is the loudest AP here in my office, but my I have been in
> > >the
> > >> >> other end of the house iwn consistently fails to associate
> > with it
> > >> >> and
> > >> >> and keeps picking the weaker AP in the far end.
> > >> >>
> > >> >> Eventually (hours!) it disconnects from the weaker ap, also with
> > >> >> "reason=0" and gets it right:
> > >> >>
> > >> >>      <3>WPA: Group rekeying completed with 6c:3b:6b:ab:ce:d4
> > >[GTK=CCMP]
> > >> >>      <3>CTRL-EVENT-DISCONNECTED bssid=6c:3b:6b:ab:ce:d4 reason
> =0
> > >> >>      <3>CTRL-EVENT-SCAN-RESULTS
> > >> >>      <3>Trying to associate with 6c:3b:6b:3d:a2:e9
> > >(SSID='Palombia'
> > >> >> freq=2452 MHz)
> > >> >>      <3>Associated with 6c:3b:6b:3d:a2:e9
> > >> >>      <3>WPA: Key negotiation completed with 6c:3b:6b:3d:a2:e9
> > >[PTK=CCMP
> > >> >> GTK=CCMP]
> > >> >>      <3>CTRL-EVENT-CONNECTED - Connection to 6c:3b:6b:3d:a2:e9
> > >> completed
> > >> >> [id=3 id_str=]
>

Re: wlan can't discover known networks after relocating

2019-09-19 Thread Cy Schubert
In message 
, Johannes Lundberg writes:
> --0875960592f275a3
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> Tested today with bgscan added. Didn=E2=80=99t connect to home network unti=
> l I
> manually run ifconfig wlan0 scan.
> Again, this is with failover lagg.

I use failover lagg too. I'm still at $JOB so no ethernet for my personal 
FreeBSD laptop here, but that works as well, at home.

>
> It did however realize I wasn't at the office anymore and the ssid =
> field
> was empty in ifconfig output. Sometimes it stays the same long after I
> leave the network.

Do you suspend/resume your laptop?


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


>
>
> On Thu, Sep 19, 2019 at 18:25 Cy Schubert  wrote=
> :
>
> > In message <7938e5fa-67da-35fa-10d0-ee3004438...@freebsd.org>, Johannes
> > Lundber
> > g writes:
> > >
> > > On 9/19/19 3:06 PM, Adrian Chadd wrote:
> > > > So roaming in ifconfig/net80211 is what's set to manual.
> > > >
> > > > wpa_supplicant right now does RSSI threshold based roaming. All of th=
> e
> > > > roaming and network preferences when wpa_supplicant is running is don=
> e
> > > > in wpa_supplicant. That's where you have to look. Ideally
> > > > wpa_supplicant would be triggering bgscan too periodically rather tha=
> n
> > > > only when the RSSI is low.
> > > >
> > > >
> > > >
> > > > -adrian
> > > >
> > > >
> > > > On Thu, 19 Sep 2019 at 15:04, Cy Schubert  > > > <mailto:cy.schub...@gmail.com>> wrote:
> > > >
> > > > On September 19, 2019 8:20:07 AM PDT, Adrian Chadd
> > > > mailto:adrian.ch...@gmail.com>> wrote:
> > > > >Roaming is done in wpa_supplicant when it's running.That's where
> > the
> > > > >smarts
> > > > >need to be. :(
> > > > >
> > > > >
> > > > >
> > > > >-adrian
> > > > >
> > > > >
> > > > >On Thu, 19 Sep 2019 at 05:44, Bjoern A. Zeeb
> > > > > > > > <mailto:bzeeb-li...@lists.zabbadoz.net>>
> > > > >wrote:
> > > > >
> > > > >> On 19 Sep 2019, at 12:28, Tom Jones wrote:
> > > > >>
> > > > >> Hi,
> > > > >>
> > > > >> freebsd-wireless might be a better list for all this ..
> > > > >>
> > > > >>
> > > > >> > On Tue, Sep 17, 2019 at 04:36:28PM +, Poul-Henning Kamp
> > > > wrote:
> > > > >> >> 
> > > > >> >> In message <707bcd3f-fa6b-82eb-fa8f-09c4b800f...@freebsd.or=
> g
> > >,
> > > > >> >> Johannes Lundber
> > > > >> >> g writes:
> > > > >> >>
> > > > >> >>> For a long time now I have had this problem with iwm and
> > wlan0.
> > > > >> >>> Whenever
> > > > >> >>> I move between work and home it won't reconnect
> > > > automatically and
> > > > >I
> > > > >> >>> have
> > > > >> >>> to do wlan0 scan manually for it to pick up the different
> > > > >network.
> > > > >> >>
> > > > >> >> I suffer from the dreaded "reason=3D0" when I move inside m=
> y
> > > > house:
> > > > >> >>
> > > > >> >>  > scan
> > > > >> >>  OK
> > > > >> >>  <3>CTRL-EVENT-SCAN-RESULTS
> > > > >> >>  <3>Trying to associate with 6c:3b:6b:3d:a2:e9
> > > > >(SSID=3D'Palombia'
> > > > >> >> freq=3D2452 MHz)
> > > > >> >>  <3>CTRL-EVENT-DISCONNECTED bssid=3D6c:3b:6b:3d:a2:e9
> > reason
> > > =3D0
> > > > >> >>  <3>CTRL-EVENT-SCAN-RESULTS
> > > > >> >>  <3>Trying to associate with 6c:3b:6b:ab:ce:d4
> > 

Re: svn commit: r355988 - in head: contrib/libpcap contrib/libpcap/cmake/Modules contrib/libpcap/doc contrib/libpcap/missing contrib/libpcap/msdos contrib/libpcap/pcap contrib/libpcap/rpcapd contri

2020-05-04 Thread Cy Schubert
Hi Adrian,

Looking at our upstream's git repo, can you try the attached patch?

Their commit log message says:

commit 23763c6516cdab2da822101a5aebd6af36122c85
Author: Yi Zhu 
Date:   Thu Dec 9 11:30:20 2010 -0800

bsd: Fix receive buffer alignment issue

wpa_supplicant seems to crash from time to time on a NetBSD 4.0 MIPS
platform. The root cause turned out to be a MIPS alignment issue.

In my wpa_supplicant crash case, in function
wpa_driver_bsd_event_receive (from driver_bsd.c), the buf[2048] address
is started from i.e. 0x7fffd546, which is not 4 bytes aligned. Later
when it is casted to (struct if_msghdr *), and rtm->rtm_flags is used.
rtm->rtm_flags is "int" type, but its address is not 4 bytes aligned.
This is because the start address of rtm is not 4 bytes aligned.
Unfortunately in NetBSD MIPS kernel (unlike Linux MIPS kernel emulates
unaligned access in its exception handler), the default behavior is to
generate a memory fault to the application that accesses unaligned
memory address. Thus comes the early mentioned wpa_supplicant crash. An
interesting note is when I'm using the wpa_supplicant version 0.4.9, I
never saw this problem. Maybe the stack layout is different. But I
didn't look into details.

I used below patch to resolve this problem. Now it runs correctly for at
least several hours. But you might have a better fix (maybe we can use
malloc/free so that it is at least cache line aligned?). I'm also not
sure if other drivers should have the same problem.

Let me know if this fixes your problem.



In message 
, Adrian Chadd writes:
> hi,
>
> This commit /seems/ to have broken things on FreeBSD-HEAD on mips74k.
> I haven't yet tried hostapd mode on x86 with this commit; I"ll do that
> soon.
>
> The TL;DR:
>
> * hostapd + wpa encryption + mips32 (mips74k in this instance) fails
> on -HEAD! Woo!
>
> * l2_packet_freebsd.c in hostapd uses a pcap filter to filter out
> eapol frames from other parties to the eapol/raw receive socket;
> * the filter compilation causes an unaligned access on mips, which i
> /thought/ we handled correctly, but apparently not;
> * the filter as written in hostapd doesn't result in anything being received.
>
> The unaligned warn is:
>
> Unaligned Load Word: pid=426 (tcpdump), tid=100040, pc=0x40569034,
> badvaddr=0x4051d02a
>
> (I dno't yet have the line of code, that's next too.)
>
> The filter is:
>
> *** Filter is "not ether src c4:6e:1f:5b:04:f7 and ( ether dst
> c4:6e:1f:5b:04:f7 or ether dst 01:80:c2:00:00:03 ) and ether proto
> 0x888e"
>
> I'll dig into the details some more soon.
>
> Thanks,
>
>
>
> -adrian
>
>
> On Sat, 21 Dec 2019 at 13:01, Cy Schubert  wrote:
> >
> > Author: cy
> > Date: Sat Dec 21 21:01:03 2019
> > New Revision: 355988
> > URL: https://svnweb.freebsd.org/changeset/base/355988
> >
> > Log:
> >   MFV r353141 (by phillip):
> >
> >   Update libpcap from 1.9.0 to 1.9.1.
> >
> >   MFC after:2 weeks
> >
> > Added:
> >   head/contrib/libpcap/CONTRIBUTING.md
> >  - copied unchanged from r353141, vendor/libpcap/dist/CONTRIBUTING.md
> >   head/contrib/libpcap/INSTALL.md
> >  - copied unchanged from r353141, vendor/libpcap/dist/INSTALL.md
> >   head/contrib/libpcap/README.md
> >  - copied unchanged from r353141, vendor/libpcap/dist/README.md
> >   head/contrib/libpcap/doc/
> >  - copied from r353141, vendor/libpcap/dist/doc/
> >   head/contrib/libpcap/missing/asprintf.c
> >  - copied unchanged from r353141, vendor/libpcap/dist/missing/asprintf.
> c
> >   head/contrib/libpcap/missing/strlcat.c
> >  - copied unchanged from r353141, vendor/libpcap/dist/missing/strlcat.c
> >   head/contrib/libpcap/missing/strlcpy.c
> >  - copied unchanged from r353141, vendor/libpcap/dist/missing/strlcpy.c
> >   head/contrib/libpcap/missing/win_asprintf.c
> >  - copied unchanged from r353141, vendor/libpcap/dist/missing/win_aspri
> ntf.c
> >   head/contrib/libpcap/pcap/socket.h
> >  - copied unchanged from r353141, vendor/libpcap/dist/pcap/socket.h
> >   head/contrib/libpcap/pcap_set_immediate_mode.3pcap.in
> >  - copied unchanged from r353141, vendor/libpcap/dist/pcap_set_immediat
> e_mode.3pcap.in
> >   head/contrib/libpcap/pcap_set_protocol_linux.3pcap
> >  - copied unchanged from r353141, vendor/libpcap/dist/pcap_set_protocol
> _linux.3pcap
> >   head/contrib/libpcap/rpcapd/
> >  - copied from r353141, vendor/libpcap/dist/rpcapd/
> >   head/contrib/libpcap/testprogs/
> >  - copie

Re: svn commit: r355988 - in head: contrib/libpcap contrib/libpcap/cmake/Modules contrib/libpcap/doc contrib/libpcap/missing contrib/libpcap/msdos contrib/libpcap/pcap contrib/libpcap/rpcapd contri

2020-05-04 Thread Cy Schubert
In message 
, Adrian Chadd writes:
> Heh, it's not this - the unaligned print only happens when I run
> tcpdump with an ether src or ether dst filter. If i just use ether
> proto it doesn't happen.
>
> So there is something unaligned going on inside libpcap /and/ somehow
> ether dst is not working right at least on mips + 802.11 DLT.

Nothing jumps out at me looking through the libpcap git logs. If you can 
get a line number to me, that would help a lot.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.


___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"