Bug#737109: hostapd: Bridged interface dropped from bridge
Package: hostapd Version: 1:1.0-3+b1 Severity: normal Tags: patch Dear Maintainer, I am using hostapd in a bridged wlan/eth setup. The wifi card is 00:08.0 Ethernet controller: Atheros Communications Inc. AR5212/AR5213 Wireless Network Adapter (rev 01) Hostapd config: interface=wlan0 bridge=br0 driver=nl80211 logger_syslog=-1 logger_syslog_level=1 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid= hw_mode=g channel=5 beacon_int=100 dtim_period=2 max_num_sta=255 rts_threshold=2347 fragm_threshold=2346 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wme_enabled=1 wme_ac_bk_cwmin=4 wme_ac_bk_cwmax=10 wme_ac_bk_aifs=7 wme_ac_bk_txop_limit=0 wme_ac_bk_acm=0 wme_ac_be_aifs=3 wme_ac_be_cwmin=4 wme_ac_be_cwmax=10 wme_ac_be_txop_limit=0 wme_ac_be_acm=0 wme_ac_vi_aifs=2 wme_ac_vi_cwmin=3 wme_ac_vi_cwmax=4 wme_ac_vi_txop_limit=94 wme_ac_vi_acm=0 wme_ac_vo_aifs=2 wme_ac_vo_cwmin=2 wme_ac_vo_cwmax=3 wme_ac_vo_txop_limit=47 wme_ac_vo_acm=0 ap_max_inactivity=300 eapol_key_index_workaround=0 eap_server=0 own_ip_addr=127.0.0.1 wpa=3 wpa_passphrase=XX wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP When using hostapd/stable, clients using the wlan are sometimes suddenly unable to communicate through the bridge and wlan0 is no longer present in the output of brctl show br0. At the same time syslog shows: /var/log/syslog.2.gz:Jan 19 11:31:07 titan kernel: device wlan0.sta1 entered promiscuous mode /var/log/syslog.2.gz:Jan 19 11:31:07 titan kernel: br0: port 3(wlan0.sta1) entering forwarding state /var/log/syslog.2.gz:Jan 19 11:31:07 titan kernel: br0: port 3(wlan0.sta1) entering forwarding state /var/log/syslog.2.gz:Jan 19 11:31:11 titan ntpd[3468]: Listen normally on 19 wlan0.sta1 fe80::20f:3dff:feaa:96f0 UDP 123 /var/log/syslog.2.gz:Jan 19 11:31:18 titan kernel: wlan0.sta1: no IPv6 routers present /var/log/syslog.2.gz:Jan 19 11:31:22 titan kernel: br0: port 3(wlan0.sta1) entering forwarding state /var/log/syslog.2.gz:Jan 19 11:31:22 titan kernel: device wlan0.sta1 left promiscuous mode /var/log/syslog.2.gz:Jan 19 11:31:22 titan kernel: br0: port 3(wlan0.sta1) entering disabled state /var/log/syslog.2.gz:Jan 19 11:31:24 titan ntpd[3468]: Deleting interface #19 wlan0.sta1, fe80::20f:3dff:feaa:96f0#123, interface stats: received=0, sent=0, dropped=0, active_time=13 secs Wireless traffic across the bridge can be restored by adding wlan0 back to the bridge with brctl addif br0 wlan0 There is a similar ticket in the OpenWRT lists at https://dev.openwrt.org/ticket/9257 Their fix is https://dev.openwrt.org/changeset/26724 I have rebuilt hostapd with an updated version of the same patch and it also seems to fix the problem for me. Perhaps you would consider including it? My patch below. The only change I made to the OpenWRT version was to reflect the move of drv-ioctl_sock to drv-global-ioctl_sock and to refresh the line numbers. Best wishes Mark Description: Port of patch from OpenWRT (https://dev.openwrt.org/browser/trunk/package/hostapd/patches/730-fix_wds_bridge_handling.patch?rev=26724) to fix Bridge on wireless AP loses wlan0 when WDS station disassociates Author: Mark Hindley m...@hindley.org.uk --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6528,6 +6528,9 @@ linux_set_iface_flags(drv-global-ioctl_sock, name, 1); return i802_set_sta_vlan(priv, addr, name, 0); } else { + if (bridge_ifname) + linux_br_del_if(drv-global-ioctl_sock, bridge_ifname, name); + i802_set_sta_vlan(priv, addr, bss-ifname, 0); return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN, name); @@ -6887,14 +6890,14 @@ return -1; #ifdef HOSTAPD - if (bss-added_if_into_bridge) { + if (type == WPA_IF_AP_BSS bss-added_if_into_bridge) { if (linux_br_del_if(drv-global-ioctl_sock, bss-brname, bss-ifname) 0) wpa_printf(MSG_INFO, nl80211: Failed to remove interface %s from bridge %s: %s, bss-ifname, bss-brname, strerror(errno)); } - if (bss-added_bridge) { + if (type == WPA_IF_AP_BSS bss-added_bridge) { if (linux_br_del(drv-global-ioctl_sock, bss-brname) 0) wpa_printf(MSG_INFO, nl80211: Failed to remove
Bug#737109: [pkg-wpa-devel] Bug#737109: hostapd: Bridged interface dropped from bridge
Hi On Thursday 30 January 2014, Mark Hindley wrote: [...] I am using hostapd in a bridged wlan/eth setup. The wifi card is 00:08.0 Ethernet controller: Atheros Communications Inc. AR5212/AR5213 Wireless Network Adapter (rev 01) [...] When using hostapd/stable, clients using the wlan are sometimes suddenly unable to communicate through the bridge and wlan0 is no longer present in the output of brctl show br0. At the same time syslog shows: /var/log/syslog.2.gz:Jan 19 11:31:07 titan kernel: device wlan0.sta1 entered promiscuous mode /var/log/syslog.2.gz:Jan 19 11:31:07 titan kernel: br0: port 3(wlan0.sta1) entering forwarding state /var/log/syslog.2.gz:Jan 19 11:31:07 titan kernel: br0: port 3(wlan0.sta1) entering forwarding state /var/log/syslog.2.gz:Jan 19 11:31:11 titan ntpd[3468]: Listen normally on 19 wlan0.sta1 fe80::20f:3dff:feaa:96f0 UDP 123 /var/log/syslog.2.gz:Jan 19 11:31:18 titan kernel: wlan0.sta1: no IPv6 routers present /var/log/syslog.2.gz:Jan 19 11:31:22 titan kernel: br0: port 3(wlan0.sta1) entering forwarding state /var/log/syslog.2.gz:Jan 19 11:31:22 titan kernel: device wlan0.sta1 left promiscuous mode /var/log/syslog.2.gz:Jan 19 11:31:22 titan kernel: br0: port 3(wlan0.sta1) entering disabled state /var/log/syslog.2.gz:Jan 19 11:31:24 titan ntpd[3468]: Deleting interface #19 wlan0.sta1, fe80::20f:3dff:feaa:96f0#123, interface stats: received=0, sent=0, dropped=0, active_time=13 secs Wireless traffic across the bridge can be restored by adding wlan0 back to the bridge with brctl addif br0 wlan0 There is a similar ticket in the OpenWRT lists at https://dev.openwrt.org/ticket/9257 Their fix is https://dev.openwrt.org/changeset/26724 I have rebuilt hostapd with an updated version of the same patch and it also seems to fix the problem for me. Perhaps you would consider including it? My patch below. The only change I made to the OpenWRT version was to reflect the move of drv-ioctl_sock to drv-global-ioctl_sock and to refresh the line numbers. [...] Thanks a lot for investigating this so well and providing a patch, which seems to have gotten decent testing and looks to be pretty straight forward. However I'm concerned that this particular patch appears to be around three years old, without having been merged into hostapd upstream, despite the patch author usually being quite active in upstream development[1] of these wireless needs... Given that the old bugtracker at w1.fi no longer exists, I can't confirm at the moment if this patch had been submitted upstream and/ or if it has been rejected for any reasons, which makes me a bit reluctant to apply it to Debian. So far I haven't come to a conclusion yet and while this patch might not be part of the very next wpa upload, I'll keep it in mind. Regards Stefan Lippers-Hollmann [1] I'm aware that OpenWrt is probably the only party actively working on 4addr support signature.asc Description: This is a digitally signed message part.
Bug#737109: [pkg-wpa-devel] Bug#737109: hostapd: Bridged interface dropped from bridge
On Thu, Jan 30, 2014 at 12:42:07PM +, Stefan Lippers-Hollmann wrote: [...] Thanks a lot for investigating this so well and providing a patch, which seems to have gotten decent testing and looks to be pretty straight forward. However I'm concerned that this particular patch appears to be around three years old, without having been merged into hostapd upstream, despite the patch author usually being quite active in upstream development[1] of these wireless needs... Given that the old bugtracker at w1.fi no longer exists, I can't confirm at the moment if this patch had been submitted upstream and/ or if it has been rejected for any reasons, which makes me a bit reluctant to apply it to Debian. So far I haven't come to a conclusion yet and while this patch might not be part of the very next wpa upload, I'll keep it in mind. Thanks. I understand your reluctance. I am not that familiar with hostapd, but wanted to share a fix for my issue ;-) Having a quick look through the current hostapd GIT (http://hostap.epitest.fi/cgit/hostap/tree/src/drivers/driver_nl80211.c), I think the patch *functionality* is incorporated: HUNK 1 appears around line 9376. The changes to wpa_driver_nl80211_if_remove() are no longer directly necessary because the order of the logic has been changed and most of the function is skipped for non WPA_IF_AP_BSS by the test if (type != WPA_IF_AP_BSS) return 0; at line 9780. The GIT implementation of wpa_driver_nl80211_if_remove() may well be cleaner and more preferable. Perhaps that would be a better fix? I hope that helps. Mark -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org