hostapd with 2 physical adapters, 2 bss's each, wlan1_0 gets wrong hwaddr

John Nielsen lists
Thu May 12 19:10:16 PDT 2011


Running hostapd 7.3 from source on Fedora 14 x86.

I have two ath9k adapters in the same machine and would like to run two VAP's (bss's) on each. Everything looks like it works fine, but the 2nd VAP on the 2nd card invariably gets the same MAC address as the 2nd VAP on the 1st card. Stations can see all of the SSID's but the fact that 2 of them have the same MAC address confuses them sooner or later.

Here are my command line, config files, and partial ifconfig output:

# hostapd -B /etc/hostapd/wlan0.conf /etc/hostapd/wlan1.conf

# cat /etc/hostapd/wlan?.conf

### wlan0.conf ###
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
logger_syslog=-1
logger_syslog_level=2
interface=wlan0

ssid=test1
hw_mode=a
channel=40
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
wpa_passphrase=XXX
driver=nl80211
wme_enabled=1
ieee80211n=1
ht_capab=[HT20][SHORT-GI-20][HT40-][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1][DELAYED-BA]

bss=wlan0_0
bssid=04:0B:6B:02:07:7E 
ssid=test2
wpa=0

### wlan1.conf ###
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
logger_syslog=-1
logger_syslog_level=2
interface=wlan1

ssid=test3
hw_mode=g
channel=5
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
wpa_passphrase=XXX
driver=nl80211
wme_enabled=1
ieee80211n=1
ht_capab=[HT20][SHORT-GI-20][HT40-][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1][DELAYED-BA]

bss=wlan1_0
bssid=04:1B:B1:5D:B0:6C
ssid=test4
wpa=0


# ifconfig -a|grep wlan
mon.wlan0 Link encap:UNSPEC  HWaddr 00-0B-6B-02-07-7E-11-2A-00-00-00-00-00-00-00-00  
mon.wlan1 Link encap:UNSPEC  HWaddr 00-1B-B1-5D-B0-6C-11-2A-00-00-00-00-00-00-00-00  
wlan0     Link encap:Ethernet  HWaddr 00:0B:6B:02:07:7E  
wlan0_0   Link encap:Ethernet  HWaddr 04:0B:6B:02:07:7E  
wlan1     Link encap:Ethernet  HWaddr 00:1B:B1:5D:B0:6C  
wlan1_0   Link encap:Ethernet  HWaddr 04:0B:6B:02:07:7E  

Notice wlan0_0 has the address specified for it in the config file and wlan1_0 has the same one (not the one configured for it). If I run only one VAP on either card there is no problem. If I run 3 VAP's on both cards the third ones work fine (wlan0_1 and wlan1_1 both have the addresses specified for them), but the 2nd one on the 2nd card (wlan1_0) still has the same MAC address as the 2nd one on the 1st card (wlan0_0).

If I change the order of the config files on the command line the problem is still with the second one specified.

If I don't specify my own bssid for any of the VAP's the problem persists--wlan0_0 gets an auto-masked bssid and wlan1_0 gets the same one.

Interestingly the debug output from hostapd shows the correct MAC address for all VAP's, including wlan1_0. Hostapd.c line 545:
wpa_printf(MSG_ERROR, "Using interface %s with hwaddr " MACSTR
			   " and ssid '%s'",
			   hapd->conf->iface, MAC2STR(hapd->own_addr),
			   hapd->conf->ssid.ssid);

I had a go at looking through the rest of the code but I haven't pinned down yet where the addr might get twiddled.

Can anyone shed some light on what might be going on? Duplicate this behavior? Give me pointers on debugging? (hoping not to have to set up gdb on this box, but it might be doable if nothing more straightforward presents itself.)

Thanks,

JN




More information about the Hostap mailing list