Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Adrian Chadd
Have you loaded all the wlan modules?



-a


On 3 January 2014 03:47, Yuri y...@rawbw.com wrote:
 I have an AP that is set up just like the handbook advises. Also the MAC
 address is changed.

 Every time wireless client disassociates, hostapd prints the following
 messages:
 wlan0: STA NN:NN:NN:NN:NN:NN IEEE 802.11: disassociated
 AP-STA-DISCONNECTED NN:NN:NN:NN:NN:NN
 ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
 ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
 ioctl[SIOCS80211, op=21, val=0, arg_len=42]: No such file or directory

 Also in case of the wrong password supplied by client, hostapd is also
 printing this:
 ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
 ioctl[SIOCS80211, op=21, val=0, arg_len=42]: No such file or directory
 wlan0: STA NN:NN:NN:NN:NN:NN IEEE 802.11: deauthenticated due to local
 deauth request
 wlan0: STA NN:NN:NN:NN:NN:NN IEEE 802.11: disassociated

 op=20 is IEEE80211_IOC_DELKEY, and op=21 is IEEE80211_IOC_MLME.

 Something is a bit broken because it prints these messages.

 9.2-STABLE

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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Yuri

On 01/03/2014 10:08, Adrian Chadd wrote:

Have you loaded all the wlan modules?



Yes, every single module /boot/kernel/wlan*.ko is loaded.

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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Yuri

On 01/03/2014 11:24, Adrian Chadd wrote:

Hm, try FreeBSD-11 and see?


It's odd, I wonder why it's finding that. Guess w'ell have to figure
out what those op=20 and op=21 are in net80211.


I did some DTrace debugging and found that ieee80211_ioctl_delkey fails 
with errno=2 (No such file), which is caused by ieee80211_find_vap_node 
returning null. And ieee80211_find_vap_node looks for some MAC address.


I think the problem is that I changed the MAC address of the ath0 
interface, and the old one got cached somewhere.


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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Adrian Chadd
Yeah, you should only change the MAC when you bring up the AP, not
during its operation.



-a


On 3 January 2014 12:08, Yuri y...@rawbw.com wrote:
 On 01/03/2014 11:24, Adrian Chadd wrote:

 Hm, try FreeBSD-11 and see?


 It's odd, I wonder why it's finding that. Guess w'ell have to figure
 out what those op=20 and op=21 are in net80211.


 I did some DTrace debugging and found that ieee80211_ioctl_delkey fails with
 errno=2 (No such file), which is caused by ieee80211_find_vap_node returning
 null. And ieee80211_find_vap_node looks for some MAC address.

 I think the problem is that I changed the MAC address of the ath0 interface,
 and the old one got cached somewhere.

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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Yuri

On 01/03/2014 12:10, Adrian Chadd wrote:

Yeah, you should only change the MAC when you bring up the AP, not
during its operation.


I was changing MAC before I was bringing it up:
ifconfig ath0 link $NEW_MAC
ifconfig wlan0 create wlandev ath0 wlanmode hostap
...

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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Adrian Chadd
Try ifconfig ath0 ether x .. why link?



-a


On 3 January 2014 12:14, Yuri y...@rawbw.com wrote:
 On 01/03/2014 12:10, Adrian Chadd wrote:

 Yeah, you should only change the MAC when you bring up the AP, not
 during its operation.


 I was changing MAC before I was bringing it up:
 ifconfig ath0 link $NEW_MAC
 ifconfig wlan0 create wlandev ath0 wlanmode hostap
 ...

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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Yuri

On 01/03/2014 12:29, Adrian Chadd wrote:

Try ifconfig ath0 ether x .. why link?


ifconfig(8) man page says: “ether” and “lladdr” are synonyms for “link”.
And it actually doesn't make any difference.

I verified that it is in fact the old MAC that is being looked up, here 
are two stacks of such failed check during the user disconnect event in 
the end:

kernel`ieee80211_ioctl_delkey+0xa1
kernel`ieee80211_ioctl_set80211+0xac9
kernel`in_control+0x1fb
kernel`ifioctl+0x803
kernel`kern_ioctl+0x106
kernel`sys_ioctl+0x157
kernel`amd64_syscall+0x5ea
kernel`0x80b55677
libc.so.7`__sys_ioctl+0xc
hostapd`bsd_set_key+0x129
hostapd`hostapd_wpa_auth_set_key+0x6d
hostapd`wpa_remove_ptk+0x5b
hostapd`wpa_auth_sm_event+0x64
hostapd`hostapd_notif_disassoc+0x8f
hostapd`bsd_wireless_event_receive+0x28d
hostapd`eloop_sock_table_dispatch+0x6c
hostapd`eloop_run+0x1b7
hostapd`main+0x372
hostapd`_start+0xa1
ld-elf.so.1`free_tls+0x40

kernel`ieee80211_ioctl_delkey+0xa1
kernel`ieee80211_ioctl_set80211+0xac9
kernel`in_control+0x1fb
kernel`ifioctl+0x803
kernel`kern_ioctl+0x106
kernel`sys_ioctl+0x157
kernel`amd64_syscall+0x5ea
kernel`0x80b55677
libc.so.7`__sys_ioctl+0xc
hostapd`bsd_set_key+0x129
hostapd`hostapd_wpa_auth_set_key+0x6d
hostapd`wpa_remove_ptk+0x5b
hostapd`sm_WPA_PTK_INITIALIZE_Enter+0x9d
hostapd`wpa_sm_step+0x1da
hostapd`hostapd_notif_disassoc+0x8f
hostapd`bsd_wireless_event_receive+0x28d
hostapd`eloop_sock_table_dispatch+0x6c
hostapd`eloop_run+0x1b7
hostapd`main+0x372
hostapd`_start+0xa1
ld-elf.so.1`free_tls+0x40

Curiously, ieee80211_find_vap_node is also queried with the original MAC 
in the beginning of the connection, and this lookup succeeded for some 
reason (here are two stacks of this):

kernel`ieee80211_ioctl_getwpaie+0x98
kernel`ieee80211_ioctl_get80211+0xb2
kernel`in_control+0x1fb
kernel`ifioctl+0x803
kernel`kern_ioctl+0x106
kernel`sys_ioctl+0x157
kernel`amd64_syscall+0x5ea
kernel`0x80b55677
libc.so.7`__sys_ioctl+0xc
hostapd`bsd_wireless_event_receive+0x175
hostapd`eloop_sock_table_dispatch+0x6c
hostapd`eloop_run+0x1b7
hostapd`main+0x372
hostapd`_start+0xa1
ld-elf.so.1`free_tls+0x40

kernel`ieee80211_ioctl_delkey+0xa1
kernel`ieee80211_ioctl_set80211+0xac9
kernel`in_control+0x1fb
kernel`ifioctl+0x803
kernel`kern_ioctl+0x106
kernel`sys_ioctl+0x157
kernel`amd64_syscall+0x5ea
kernel`0x80b55677
libc.so.7`__sys_ioctl+0xc
hostapd`bsd_set_key+0x129
hostapd`hostapd_wpa_auth_set_key+0x6d
hostapd`wpa_remove_ptk+0x5b
hostapd`wpa_auth_sm_event+0x64
hostapd`hostapd_notif_assoc+0x128
hostapd`bsd_wireless_event_receive+0x1d7
hostapd`eloop_sock_table_dispatch+0x6c
hostapd`eloop_run+0x1b7
hostapd`main+0x372
hostapd`_start+0xa1
ld-elf.so.1`free_tls+0x40

Since the new MAC address has been set on ath0 before AP was brought up, 
old MAC should never (IMO) appear in any lookups anywhere at all.

So there is definitely a leak of the original MAC address somewhere.

You probably know the code of hostapd, maybe you can see from these 
stacks where does hostapd get the original MAC from?


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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Adrian Chadd
I don't know the hostapd codebase all that well.

So you're changing the MAC before you start hostapd, right?


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


Re: hostapd prints errors like this: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory

2014-01-03 Thread Yuri

On 01/03/2014 22:07, Adrian Chadd wrote:

I don't know the hostapd codebase all that well.

So you're changing the MAC before you start hostapd, right?


Yes, before AP start. You can think it has been changed once before the 
AP started, and never touched again.


We just need to figure out where the old MAC comes from during hostapd 
lifetime.


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