interfaces: adjust wireless handling slightly for new return code

This commit is contained in:
Franco Fichtner 2023-09-20 09:29:49 +02:00
parent 9c1342dac9
commit 2396e4b3ff
2 changed files with 2 additions and 2 deletions

View File

@ -952,7 +952,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if ($clone_count > 1) {
$wlanif = get_real_interface($if);
$a_interfaces[$if]['wireless']['mode'] = $pconfig['mode'];
if (!_interfaces_wlan_clone("{$wlanif}_", $a_interfaces[$if])) {
if (empty(_interfaces_wlan_clone("{$wlanif}_", $a_interfaces[$if]))) {
$input_errors[] = sprintf(gettext("Unable to change mode to %s. You may already have the maximum number of wireless clones supported in this mode."), $wlan_modes[$a_interfaces[$if]['wireless']['mode']]);
} else {
legacy_interface_destroy("{$wlanif}_");

View File

@ -101,7 +101,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
if (count($input_errors) == 0) {
if (!_interfaces_wlan_clone($clone['cloneif'], $clone)) {
if (empty(_interfaces_wlan_clone($clone['cloneif'], $clone))) {
$input_errors[] = sprintf(gettext('Error creating interface with mode %s. The %s interface may not support creating more clones with the selected mode.'), $wlan_modes[$clone['mode']], $clone['if']);
} else {
if (isset($id)) {