Bug 208933 - [regression] "ifconfig wlan0 ether ..." broken after r297592
Summary: [regression] "ifconfig wlan0 ether ..." broken after r297592
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-wireless
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-04-20 13:44 UTC by Fabian Keil
Modified: 2016-10-04 19:45 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Keil 2016-04-20 13:44:51 UTC
After r297592, wpa_supplicant can no longer associate to an AP
if wlan0's MAC address has been changed with "ifconfig wlan0 ether ...":

wpa_supplicant[76190]: wlan0: Trying to associate with [...] (SSID='[...]' freq=2447 MHz)
wpa_supplicant[76190]: wlan0: Authentication with [...] timed out.
wpa_supplicant[76190]: wlan0: CTRL-EVENT-DISCONNECTED bssid=[...]reason=3 locally_generated=1

After destroying the device and recreating it without changing the
MAC address afterwards, wpa_supplicant can associate with the AP again.

In my case the wlandev is iwn0, but looking at r297592 I suspect that
this is not a device-specific issue.

Reverting r297592 works around the problem.
Comment 1 commit-hook freebsd_committer 2016-05-02 20:46:49 UTC
A commit references this bug:

Author: avos
Date: Mon May  2 20:46:05 UTC 2016
New revision: 298941
URL: https://svnweb.freebsd.org/changeset/base/298941

Log:
  net80211: fix MAC address change via SIOCSIFLLADDR ioctl.

  Recheck MAC address on SIOCSIFFLAGS; as a result,
  'ifconfig wlan0 ether <addr>' can be used after interface startup.

  PR:		208933

Changes:
  head/sys/net80211/ieee80211_ioctl.c
Comment 2 Ronald Klop 2016-05-06 09:04:46 UTC
I'm still seeing this problem.

FreeBSD sjakie.klop.ws 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r299063M: Fri May  6 10:39:44 CEST 2016     root@sjakie.klop.ws:/usr/obj/usr/src/sys/GENERIC-NODEBUG  amd64
iwn0: <Intel Centrino Advanced 6235> mem 0xf8000000-0xf8001fff irq 17 at device 0.0 on pci3

WLAN works when booting normal:
ifconfig_wlan0="country NL WPA SYNCDHCP"

But when I use if_lagg (or only the ether xx:xx option) it does not associate.
ifconfig_bge0="up"
wlans_iwn0="wlan0"
ifconfig_wlan0="ether 00:26:b9:**:**:** country NL WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport bge0 laggport wlan0 SYNCDHCP"

I added -d to wpa_supplicant, so can provide debugging info if needed.

Regards,
Ronald.
Comment 3 Andriy Voskoboinyk freebsd_committer 2016-05-06 09:26:03 UTC
(In reply to Ronald Klop from comment #2)
Just a note: you can use 'wlanaddr' instead of 'ether'.
Comment 4 Fabian Keil 2016-05-06 09:56:03 UTC
r298941 seems to fix the issue for me as advertised. Thanks, Andriy.
Comment 5 Ronald Klop 2016-05-06 10:39:55 UTC
(In reply to Andriy Voskoboinyk from comment #3)
Took some time to figure out wlanaddr must be used in 
create_args_wlan0="wlanaddr 00:26:b9:**:**:**"
instead of an ifconfig_wlan0 line.
But my WLAN works again now.
Thanks.
Comment 6 Masachika ISHIZUKA 2016-05-06 11:10:55 UTC
(In reply to Andriy Voskoboinyk from comment #3)
Thank you for good information.

My PC (r298976) (dell studio1558 with re0(realtek 8111DL) and iwn0(N-6300 with iwn6000g2bfw.ko)) can work with lagg0 when create_args_wlan0="wlanaddr ..."
instead of ifconfig_iwn0="ether ...".
Comment 7 commit-hook freebsd_committer 2016-05-06 11:42:23 UTC
A commit references this bug:

Author: avos
Date: Fri May  6 11:41:50 UTC 2016
New revision: 299171
URL: https://svnweb.freebsd.org/changeset/base/299171

Log:
  net80211: restore 'iflladdr_event' event handler.

  Now 'ether' argument to ifconfig can be used as an alias to 'wlanaddr'.

  PR:		208933

Changes:
  head/sys/net80211/ieee80211_freebsd.c
Comment 8 Andriy Voskoboinyk freebsd_committer 2016-05-17 12:57:34 UTC
Should be fixed now.