mirror of
https://github.com/opnsense/core.git
synced 2026-02-18 18:18:13 -05:00
interfaces: fix wlanmode usage part 2 #9727
This commit is contained in:
parent
d4eb6235ae
commit
4912a671be
1 changed files with 3 additions and 15 deletions
|
|
@ -1655,18 +1655,6 @@ function _interfaces_wlan_clone($device, $wlcfg)
|
|||
$wlcfg_mode = $wlcfg['mode'] ?? 'bss';
|
||||
}
|
||||
|
||||
switch ($wlcfg_mode) {
|
||||
case "hostap":
|
||||
$mode = 'wlanmode hostap';
|
||||
break;
|
||||
case "adhoc":
|
||||
$mode = 'wlanmode adhoc';
|
||||
break;
|
||||
default:
|
||||
$mode = '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (does_interface_exist($device)) {
|
||||
$ifconfig_str = shell_safe('/sbin/ifconfig %s', $device);
|
||||
if (($wlcfg_mode == 'hostap') && !preg_match('/hostap/si', $ifconfig_str)) {
|
||||
|
|
@ -1693,9 +1681,9 @@ function _interfaces_wlan_clone($device, $wlcfg)
|
|||
$wlan_frmt = ['/sbin/ifconfig wlan create wlandev %s'];
|
||||
$wlan_args = [$baseif];
|
||||
|
||||
if (strlen($mode)) {
|
||||
$wlan_args[] = $mode;
|
||||
$wlan_frmt[] = '%s';
|
||||
if (in_array($wlcfg_mode, ['adhoc', 'hostap'])) {
|
||||
$wlan_frmt[] = 'wlanmode %s';
|
||||
$wlan_args[] = $wlcfg_mode;
|
||||
}
|
||||
|
||||
$wlan_frmt[] = 'bssid name %s';
|
||||
|
|
|
|||
Loading…
Reference in a new issue