Do not specify a wlan # and let freebsd decide and return the interface that was created before renaming.

This commit is contained in:
Scott Ullrich 2009-10-25 18:31:24 -04:00
parent 19e83210b0
commit cddb1be2e9

View File

@ -1306,8 +1306,8 @@ function interface_wireless_clone($if, $wlcfg) {
// Setup wireless nic
if($wlcfg['wireless']['mode'] == "hostap")
$mode = "wlanmode hostap";
exec("/sbin/ifconfig wlan{$interface_num} create wlandev {$wlcfg['if']} {$mode}");
exec("/sbin/ifconfig wlan{$interface_num} name {$wlcfg['if']}_wlan{$interface_num}");
$newif = trim(`/sbin/ifconfig wlan create wlandev {$wlcfg['if']} {$mode}`);
exec("/sbin/ifconfig wlan{$newif} name {$wlcfg['if']}_wlan{$interface_num}");
}
}