After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771005 - After upgrade networkmanager-1.08 -> 1.4.0 WiFi will not connect
After upgrade networkmanager-1.08 -> 1.4.0 WiFi will not connect
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: Wi-Fi
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: Thomas Haller
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-09-07 13:13 UTC by john.frankish@outlook.com
Modified: 2016-09-16 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log file attached (3.71 KB, application/x-gzip)
2016-09-07 13:57 UTC, john.frankish@outlook.com
  Details
networkmanager and wpa_supplicant error logs (3.76 KB, application/x-gzip)
2016-09-11 06:46 UTC, john.frankish@outlook.com
  Details
nm-git and wpa-supplicant-2.1 logs (36.95 KB, application/x-gzip)
2016-09-14 07:18 UTC, john.frankish@outlook.com
  Details
'seems the default is /usr/local/etc/NetworkManager/nm-system-settings.conf (35.73 KB, application/x-gzip)
2016-09-14 11:57 UTC, john.frankish@outlook.com
  Details
nm-log-2.txt (403.21 KB, text/plain)
2016-09-14 15:47 UTC, Thomas Haller
  Details
latest log files (50.64 KB, application/x-gzip)
2016-09-15 13:34 UTC, john.frankish@outlook.com
  Details
and more logs (35.69 KB, application/x-gzip)
2016-09-16 06:24 UTC, john.frankish@outlook.com
  Details
[patch] for supplicant 2.1 to properly re-read the MAC address (5.38 KB, patch)
2016-09-16 08:46 UTC, Thomas Haller
none Details | Review

Description john.frankish@outlook.com 2016-09-07 13:13:42 UTC
Using networkmanager-1.4.0 in gnome-3.21.x

I am able to connect to wired networks without problems.

I am unable to connect to a WPA2-personal WiFi network that does not broadcast the SSID using networkmanager-1.4.0

networkmanager-1.0.8/gnome-3.16.x will connect to the same network on the same machine.

I can also connect to the same network in gnome-3.21.x using udhcpc manually.

log output below - are there any troubleshooting steps I can try?

----------

Sep  7 16:30:08 boxdell daemon.info NetworkManager[25852]: <info>  [1473265808.6996] (wlan0): using nl80211 for WiFi device control
Sep  7 16:30:08 boxdell daemon.info NetworkManager[25852]: <info>  [1473265808.6998] device (wlan0): driver supports Access Point (AP) mode
Sep  7 16:30:08 boxdell daemon.info NetworkManager[25852]: <info>  [1473265808.7004] manager: (wlan0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/5)
Sep  7 16:30:08 boxdell daemon.info NetworkManager[25852]: <info>  [1473265808.7011] device (wlan0): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Sep  7 16:30:08 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:08 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:08 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:08 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:08 boxdell daemon.info NetworkManager[25852]: <info>  [1473265808.9349] device (wlan0): set-hw-addr: set MAC address to 1A:99:B5:37:B8:20 (scanning)
Sep  7 16:30:08 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:08 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:09 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:09 boxdell user.info kernel: iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
Sep  7 16:30:09 boxdell daemon.notice dbus[25848]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Sep  7 16:30:09 boxdell daemon.notice dbus[25848]: [system] Activating service name='fi.w1.wpa_supplicant1' (using servicehelper)
Sep  7 16:30:09 boxdell daemon.notice dbus[25848]: [system] Activating service name='org.freedesktop.ModemManager1' (using servicehelper)
Sep  7 16:30:09 boxdell daemon.info ModemManager[25865]: <info>  ModemManager (version 1.6.0) starting in system bus...
Sep  7 16:30:09 boxdell daemon.info polkitd[25861]: Started polkitd version 0.112
Sep  7 16:30:09 boxdell daemon.notice dbus[25848]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'
Sep  7 16:30:09 boxdell daemon.info NetworkManager[25852]: <info>  [1473265809.2668] supplicant: wpa_supplicant running
Sep  7 16:30:09 boxdell daemon.info NetworkManager[25852]: <info>  [1473265809.2669] device (wlan0): supplicant interface state: init -> starting
Sep  7 16:30:09 boxdell authpriv.notice polkitd[25861]: Loading rules from directory /usr/local/etc/polkit-1/rules.d
Sep  7 16:30:09 boxdell authpriv.notice polkitd[25861]: Loading rules from directory /usr/local/share/polkit-1/rules.d
Sep  7 16:30:09 boxdell authpriv.notice polkitd[25861]: Finished loading, compiling and executing 3 rules
Sep  7 16:30:09 boxdell daemon.notice dbus[25848]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Sep  7 16:30:09 boxdell authpriv.notice polkitd[25861]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
Sep  7 16:30:09 boxdell daemon.info NetworkManager[25852]: <info>  [1473265809.3011] sup-iface[0x211b950,wlan0]: supports 5 scan SSIDs
Sep  7 16:30:09 boxdell daemon.info NetworkManager[25852]: <info>  [1473265809.3016] device (wlan0): supplicant interface state: starting -> ready
Sep  7 16:30:09 boxdell daemon.info NetworkManager[25852]: <info>  [1473265809.3017] device (wlan0): state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42]
Comment 1 Thomas Haller 2016-09-07 13:28:26 UTC
please enable level=TRACE logging and attach the logfile of NetworkManager.

see https://cgit.freedesktop.org/NetworkManager/NetworkManager/plain/contrib/fedora/rpm/NetworkManager.conf?id=c90ec2d8c8a12b44c908bf7f80b23059c29f68fa

Thanks
Comment 2 john.frankish@outlook.com 2016-09-07 13:57:53 UTC
Created attachment 334987 [details]
log file attached
Comment 3 Thomas Haller 2016-09-07 15:01:09 UTC
does it workaround the issue to configure

[device]
wifi.scan-rand-mac-address=0

in /etc/NetworkManager/NetworkManager.conf. Then restart NetworkManager and re-test.

Does it the failure to connect happen every time?
Comment 4 john.frankish@outlook.com 2016-09-08 10:05:00 UTC
I take it you meant:

[device]
wifi.scan-rand-mac-address=0

and not:

[wlan0]
wifi.scan-rand-mac-address=0

..but I tried both and neither helped.

Note that I also have the following (I recall it was required to fix something a while back):

$ cat /usr/local/etc/NetworkManager/nm-system-settings.conf
[main]
plugins=keyfile
# [logging]
# level=DEBUG

I've tried to connect tens of times, but it fails to connect every time :(
Comment 5 john.frankish@outlook.com 2016-09-08 12:12:48 UTC
As compared to my wpa_supplicant config that works with udhcpc, I see the following differences with the networkmanager config:

$ sudo cat /usr/local/etc/NetworkManager/system-connections/myhiddenssidwifi

[wifi-security]
group=[ccmp]
key-mgmt=wpa-psk
pairwise= [ccmp]
proto= [wpa2]
psk=blahblah

..where the entries [*] are blank in networkmanager. However adding them does not make things work.

Are there a number of commands I can enter at the command prompt to attempt to connect?
Comment 6 Thomas Haller 2016-09-08 12:58:41 UTC
(In reply to john.frankish@outlook.com from comment #4)
> I take it you meant:
> 
> [device]
> wifi.scan-rand-mac-address=0

yes, this is described in `man NetworkManager.conf`.




Can you obtain logfiles from wpa-supplicant?

An instruction is here: https://wiki.gnome.org/Projects/NetworkManager/Debugging#Debugging_WiFi_Connections (although this howto didn't work for me recently, in that case you might need something more to get the logs).
Comment 7 john.frankish@outlook.com 2016-09-08 13:40:30 UTC
Unfortunately, even though the dbus commands do not return errors, I am unable to get a log from wpa_supplicant.

BTW, if I change my WAP settings to broadcast the SSID, networkmanager still fails to connect.
Comment 8 john.frankish@outlook.com 2016-09-08 14:03:53 UTC
Got it - it appears you have to modify the dbus service file before the dbus daemon is first started.

Successfully initialized wpa_supplicant
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: Reject scan trigger since one is already pending
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: SME: Trying to authenticate with c4:7d:4f:88:a9:b9 (SSID='******' freq=2462 MHz)
wlan0: SME: Deauth request to the driver failed
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: SME: Trying to authenticate with c4:7d:4f:88:a9:b9 (SSID='******' freq=2462 MHz)
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: SME: Trying to authenticate with c4:7d:4f:88:a9:b9 (SSID='******' freq=2462 MHz)
wlan0: CTRL-EVENT-DISCONNECTED bssid=c4:7d:4f:88:a9:b9 reason=3 locally_generated=1
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: Reject scan trigger since one is already pending
wlan0: CTRL-EVENT-SCAN-STARTED 
wlan0: CTRL-EVENT-SCAN-STARTED
Comment 9 john.frankish@outlook.com 2016-09-11 06:43:09 UTC
I had another go at this (networkmanager and wpa_supplicant logs attached below).

From this snippet, maybe there is a timing issue?

daemon.info NetworkManager[25032]: <info>  [1473588881.2697] device (wlan0): supplicant interface state: disconnected -> scanning
user.info kernel: wlan0: authenticate with c4:7d:4f:88:a9:b9
user.info kernel: wlan0: send auth to c4:7d:4f:88:a9:b9 (try 1/3)
user.info kernel: wlan0: authenticated
daemon.info NetworkManager[25032]: <info>  [1473588884.6824] device (wlan0): supplicant interface state: scanning -> authenticating
user.err kernel: iwlwifi 0000:02:00.0: No association and the time event is over already...
user.info kernel: wlan0: Connection to AP c4:7d:4f:88:a9:b9 lost
user.info kernel: wlan0: aborting authentication with c4:7d:4f:88:a9:b9 by local choice (Reason: 3=DEAUTH_LEAVING)
daemon.info NetworkManager[25032]: <info>  [1473588889.6963] device (wlan0): supplicant interface state: authenticating -> disconnected
daemon.info NetworkManager[25032]: <info>  [1473588890.1970] device (wlan0): supplicant interface state: disconnected -> scanning
user.info kernel: wlan0: authenticate with c4:7d:4f:88:a9:b9
user.info kernel: wlan0: send auth to c4:7d:4f:88:a9:b9 (try 1/3)
user.info kernel: wlan0: authenticated
daemon.info NetworkManager[25032]: <info>  [1473588893.6082] device (wlan0): supplicant interface state: scanning -> authenticating
daemon.warn NetworkManager[25032]: <warn>  [1473588893.7556] device (wlan0): Activation: (wifi) association took too long, failing activation
daemon.info NetworkManager[25032]: <info>  [1473588893.7556] device (wlan0): state change: config -> failed (reason 'ssid-not-found') [50 120 53]
daemon.info NetworkManager[25032]: <info>  [1473588893.7558] manager: NetworkManager state is now DISCONNECTED
daemon.warn NetworkManager[25032]: <warn>  [1473588893.7570] device (wlan0): Activation: failed for connection '******'
daemon.info NetworkManager[25032]: <info>  [1473588893.7576] device (wlan0): state change: failed -> disconnected (reason 'none') [120 30 0]
user.info kernel: wlan0: aborting authentication with c4:7d:4f:88:a9:b9 by local choice (Reason: 3=DEAUTH_LEAVING)
Comment 10 john.frankish@outlook.com 2016-09-11 06:46:19 UTC
Created attachment 335292 [details]
networkmanager and wpa_supplicant error logs
Comment 11 john.frankish@outlook.com 2016-09-13 13:23:34 UTC
I updated networkmanager to the latest git, which did not help.

I then updated wpa_supplicant from 2.1 -> 2,5 and things work :)
Comment 12 john.frankish@outlook.com 2016-09-13 13:36:40 UTC
I reverted networkmanager from git -> 1.4.0 and things still worked with wpa_supplicant-2.5 - although it did take two attempts to connect.

..so it seems networkmanager-1.4.0 requires wpa_supplicant > 2.1 (although I have not tested 2.2, 2.3 or 2.4)
Comment 13 Thomas Haller 2016-09-13 13:49:10 UTC
please attach full logfiles of both NetworkManager and wpa_supplicant, that show the issue.

For NetworkManager, make sure to enable "level=TRACE" in NetworkManager.conf. For wpa_supplicant, make sure that the supplicant is started with "-dddt" to get a high logging verbosity and timestamps.

Thanks.
Comment 14 john.frankish@outlook.com 2016-09-13 13:59:52 UTC
Do you mean the logfiles from it failing with wpa_supplicant-2.1 or succeeding with wpa_supplicant-2.5?

Should I use networkmanager-1.4.0 or git?
Comment 15 Thomas Haller 2016-09-13 14:06:45 UTC
sorry for being unclear.

If I understand correctly "NM-master+supplicant-2.5" works, but "NM-master+supplicant-2.1" does not work.

Most interesting would be an fail-example of "NM-master" with a supplicant version that has the issue (2.1?).

Reason being, that NM-master is supposed to work with various versions of wpa_supplicant.
Comment 16 john.frankish@outlook.com 2016-09-14 07:18:03 UTC
Created attachment 335486 [details]
nm-git and wpa-supplicant-2.1 logs
Comment 17 Thomas Haller 2016-09-14 08:07:28 UTC
Hi John. Thanks for the logfile.
Note that you didn't enable level=TRACE logging for NetworkManager. You can see that, because there are only messages with <info> level, no <debug> or <trace>. Anyway... it's good for the moment. Thanks.


NetworkManager first sets a random MAC address during scanning:

<info>  [1473850841.5517] device (wlan0): set-hw-addr: set MAC address to 0A:71:C1:62:73:AD (scanning)

which also supplicant confirms:

1473850841.836320: wlan0: Own MAC address: 0a:71:c1:62:73:ad


during activation, NM resets the previous MAC address:

<info>  [1473850886.3566] device (wlan0): set-hw-addr: reset MAC address to A0:A8:CD:2C:3E:13 (preserve)

but supplicant misses that change. Which is interesting, because https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=32f7c1d4b9aba597a99128631f07c2985149f303 is supposed to work-around that.


John, when you say, you tested "nm-git", which commit was that? It should at least be 32f7c1d4b9aba597a99128631f07c2985149f303 or newer.



This issue seems to be a duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=770504#c12
Comment 18 john.frankish@outlook.com 2016-09-14 08:20:17 UTC
Ah - sorry, I set things up like this:

$ cat /usr/local/etc/NetworkManager/NetworkManager.conf

[main]
plugins=keyfile

[logging]
level=TRACE
domains=ALL

..but maybe I also need "level=DEBUG"?

Note also, I needed:

$ cat /usr/local/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service
[D-BUS Service]
Name=fi.epitest.hostap.WPASupplicant
Exec=/usr/local/sbin/wpa_supplicant -u -f /var/log/wpa_supplicant.log -dddt
User=root
SystemdService=wpa_supplicant.service

..which seems to contradict the info given in the above comments (since wpa_supplicant > 0.6).

I cloned nm git after the commit labelled "device: cleanup _hw_addr_set()"
Comment 19 Thomas Haller 2016-09-14 09:22:27 UTC
(In reply to john.frankish@outlook.com from comment #18)
> Ah - sorry, I set things up like this:
> 
> $ cat /usr/local/etc/NetworkManager/NetworkManager.conf
> 
> [main]
> plugins=keyfile
> 
> [logging]
> level=TRACE
> domains=ALL

this looks very right. Maybe NM is not reading this file?
You can verify with

  /path/to/NetworkManager --print-config


> Note also, I needed:
> 
> $ cat
> /usr/local/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.
> service
> [D-BUS Service]
> Name=fi.epitest.hostap.WPASupplicant
> Exec=/usr/local/sbin/wpa_supplicant -u -f /var/log/wpa_supplicant.log -dddt
> User=root
> SystemdService=wpa_supplicant.service
> 
> ..which seems to contradict the info given in the above comments (since
> wpa_supplicant > 0.6).

yeah, seems that howto is not working well... the -dddt is correct and the log you attached before was helpful. thanks.


> I cloned nm git after the commit labelled "device: cleanup _hw_addr_set()"

Too bad, this commit should have the fix...

I think this is a wpa_supplicant issue, but it would be strongly preferred that NM can workaround it.

Can you please reproduce the scenario from comment 16 again, this time with level=TRACE in NetworkManager. Because then in the NM log are all the netlink events visible, and there seems to be something special about their order (which probably depends on your driver)
Comment 20 john.frankish@outlook.com 2016-09-14 11:57:26 UTC
Created attachment 335511 [details]
'seems the default is /usr/local/etc/NetworkManager/nm-system-settings.conf
Comment 21 Thomas Haller 2016-09-14 15:47:42 UTC
Created attachment 335538 [details]
nm-log-2.txt

(In reply to john.frankish@outlook.com from comment #20)
> Created attachment 335511 [details]
> 'seems the default is /usr/local/etc/NetworkManager/nm-system-settings.conf

Thanks John. Here both files merged for easier review.
Comment 22 Thomas Haller 2016-09-14 16:23:20 UTC
(In reply to Thomas Haller from comment #21)
> Created attachment 335538 [details]
> nm-log-2.txt

I think NetworkManager master does now everything correctly. With https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=32f7c1d4b9aba597a99128631f07c2985149f303 , NM waits until the MAC address is fully changed before setting the interface up (to workaround brcmfmac).

There is still an supplicant issue, which is probably fixed upstream by https://w1.fi/cgit/hostap/commit/?id=3e0272ca00ce1df35b45e7d739dd7e935f13fd84 .

Although, as dcbw points out in https://bugzilla.gnome.org/show_bug.cgi?id=770504#c12 , supplicant still might have a race.
Comment 23 Thomas Haller 2016-09-14 16:43:51 UTC
John, seeing that you are able to compile from source :)
Could you test supplicant 2.1 with commit e0272ca00ce1df35b45e7d739dd7e935f13fd84?
Comment 24 john.frankish@outlook.com 2016-09-15 06:23:40 UTC
Hmm - maybe I've misunderstood something here, but I was already testing with networkmanager compiled from the git commit after that:

device: cleanup _hw_addr_set()  <-- I cloned git from here
device: wait for MAC address change to complete before setting interface up

If I have misunderstood, maybe you could pass me the appropriate git command to get what is required.
Comment 25 Thomas Haller 2016-09-15 06:54:13 UTC
(In reply to john.frankish@outlook.com from comment #24)
> Hmm - maybe I've misunderstood something here, but I was already testing
> with networkmanager compiled from the git commit after that:

I meant to compile wpa_supplianct from source:

the combination
 - NetworkManager (git-master), as you did in comment 20
 - with wpa_supplicant 2.1 with commit https://w1.fi/cgit/hostap/commit/?id=3e0272ca00ce1df35b45e7d739dd7e935f13fd84
Comment 26 john.frankish@outlook.com 2016-09-15 07:12:46 UTC
Sorry to be dense, but do you mean:

apply the commit 3e0272ca00ce1df35b45e7d739dd7e935f13fd84 as a patch to the wpa_supplicant-2.1 source (I have the tarball somewhere)?

or

issue several git commands to fetch hostap_2_1 and then update it with/to the commit 3e0272ca00ce1df35b45e7d739dd7e935f13fd84?

If the latter, you'll need to supply the relevent git commands to avoid confusion.
Comment 27 Thomas Haller 2016-09-15 08:12:43 UTC
(In reply to john.frankish@outlook.com from comment #26)
> Sorry to be dense, but do you mean:

No problem :)


> apply the commit 3e0272ca00ce1df35b45e7d739dd7e935f13fd84 as a patch to the
> wpa_supplicant-2.1 source (I have the tarball somewhere)?
> 
> or
> 
> issue several git commands to fetch hostap_2_1 and then update it with/to
> the commit 3e0272ca00ce1df35b45e7d739dd7e935f13fd84?
> 
> If the latter, you'll need to supply the relevent git commands to avoid
> confusion.

probably it's best and simplest, if you recompile exactly the 2.1 supplicant that you are using now, with the single patch https://w1.fi/cgit/hostap/patch/?id=3e0272ca00ce1df35b45e7d739dd7e935f13fd84 applied. It should apply nicely.

It sounds like you previously build your 2.1 from the release tarball at https://w1.fi/releases/. Just rebuild it with the patch. Ok?
Comment 28 john.frankish@outlook.com 2016-09-15 09:48:19 UTC
If I rebuild with the patch (which applies cleanly), make fails with:

  CC  ../src/l2_packet/l2_packet_linux.c
../src/drivers/driver_nl80211.o: In function `wpa_driver_nl80211_event_rtm_newlink':
driver_nl80211.c:(.text+0x25a8): undefined reference to `get_bss_ifindex'
collect2: error: ld returned 1 exit status
Makefile:1569: recipe for target 'wpa_supplicant' failed
make: *** [wpa_supplicant] Error 1

Note that it does not fail without the patch.
Comment 29 Thomas Haller 2016-09-15 11:08:42 UTC
(In reply to john.frankish@outlook.com from comment #28)
> If I rebuild with the patch (which applies cleanly), make fails with:

sorry, my bad. You also need commit https://w1.fi/cgit/hostap/patch/?id=5dfbd725a95d50475c63ab3a2e85031afd68614b.


This works for me:


  git clone git://w1.fi/hostap.git
  cd ./hostap
  git checkout -b 2.1 hostap_2_1
  cp wpa_supplicant/defconfig wpa_supplicant/.config
  make -C wpa_supplicant
  git cherry-pick -x 5dfbd725a95d50475c63ab3a2e85031afd68614b
  git cherry-pick -x 3e0272ca00ce1df35b45e7d739dd7e935f13fd84
  make -C wpa_supplicant
Comment 30 john.frankish@outlook.com 2016-09-15 12:07:33 UTC
It compiled without the first "make -C wpa_supplicant: :)

..but things still don't work.

Although I enter my wifi password as part of the "connect to a hidden network" dialogue (gnome-3.21.x), I continually get a pop-up with the message "authentification required by wireless network" that requests my wifi password again and again, but never connects.
Comment 31 Thomas Haller 2016-09-15 12:23:03 UTC
Too bad. Could you show the logfiles please?
Comment 32 john.frankish@outlook.com 2016-09-15 13:34:20 UTC
Created attachment 335640 [details]
latest log files
Comment 33 Thomas Haller 2016-09-15 16:36:17 UTC
(In reply to john.frankish@outlook.com from comment #32)
> Created attachment 335640 [details]
> latest log files

Hi John. Very helpful. Could you please retry with
https://github.com/NetworkManager/hostap/commits/th/bgo771005

  git clone git://w1.fi/hostap.git
  cd ./hostap
  git remote add nm git@github.com:NetworkManager/hostap.git
  git fetch nm
  git checkout -t refs/remotes/nm/th/bgo771005
  cp wpa_supplicant/defconfig wpa_supplicant/.config
  make -C wpa_supplicant
Comment 34 Thomas Haller 2016-09-15 16:37:42 UTC
should be:
  git remote add https://github.com/NetworkManager/hostap.git
Comment 35 john.frankish@outlook.com 2016-09-16 06:23:50 UTC
That would be "git remote add nm https://github.com/NetworkManager/hostap.git", right :)

It works

logs to follow
Comment 36 john.frankish@outlook.com 2016-09-16 06:24:45 UTC
Created attachment 335675 [details]
and more logs
Comment 37 Thomas Haller 2016-09-16 08:46:04 UTC
Created attachment 335683 [details] [review]
[patch] for supplicant 2.1 to properly re-read the MAC address

Hi John,

thank you for all the effort with testing.
I think it was important to understand what the issue really is.


To summarize the finding:



With certain configuration, the issue could happen before 1.4.0 as well. However, issue is with 1.4.0 more apparent as NetworkManager now changes the MAC address much more frequently (and by default). One workaround for NetworkManager is to configure NetworkManager.conf with:

  [device]
  wifi.scan-rand-mac-address=0

and ensure that the per-connection setting wifi.cloned-mac-address is "preserve".
"permanent" would work too if the address is already the permanent MAC address so that no change is necessary.




Since 1.4.0 release, NetworkManager added a few workarounds for kernel drivers when changing the MAC address. So, you might have issues with 1.4.0 release, but NetworkManager's master seems fixed.
These workarounds are important especially if you use for example brcmfmac. That driver can first indicate the interface as IFF_UP, but only later actually change the MAC address. Probably there are bugs in wpa_supplicant's master about that, see for example:
  https://w1.fi/cgit/hostap/commit/?id=3e0272ca00ce1df35b45e7d739dd7e935f13fd84
which says:
  "Changing an interface's MAC address requires that the interface be down, the 
   change made, and then the interface brought back up."
that is true, but reading the MAC address when the interface just came up might still yield the wrong MAC address.

NetworkManager now works around that by waiting until the MAC address changed:
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/devices/nm-device.c?id=2a391348b6906a728d68ef5758b6bf102318986a#n11843



wpa_supplicant must also properly re-read the MAC address. For one, it means you need https://w1.fi/cgit/hostap/commit/?id=3e0272ca00ce1df35b45e7d739dd7e935f13fd84 and https://w1.fi/cgit/hostap/commit/?id=c267753ba2cc006907c57cf11b06d658f783682f .
Actually, you don't need the entire commit c267753, but only the change to wpa_supplicant_update_mac_addr().
That means, supplicant >= 2.3 should work well enough.
The attached patch should fix the issue for 2.1 supplicant.
Comment 38 Thomas Haller 2016-09-16 09:25:10 UTC
Probably 2.0 is mostly fine too, because it called wpa_sm_set_own_addr() from wpa_supplicant_update_mac_addr().
That was broken with 2.1 by https://w1.fi/cgit/hostap/commit/?id=c68f6200a72f2b33304f583859b09e57757b9d2a