Skip to content

Commit

Permalink
interfaces: simplify destroy as we do not log it any longer
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Feb 24, 2022
1 parent d9ddc7b commit 84cd38a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 3 additions & 10 deletions src/etc/inc/interfaces.inc
Expand Up @@ -1700,10 +1700,7 @@ function interface_wireless_clone($realif, $wlcfg)
}

if ($needs_clone) {
/* remove previous instance if it exists */
if (does_interface_exist($realif)) {
legacy_interface_destroy($realif);
}
legacy_interface_destroy($realif);

log_error("Cloning new wireless interface {$realif}");
exec("/sbin/ifconfig wlan create wlandev {$baseif} {$mode} bssid name {$realif} 2>&1", $out, $ret);
Expand Down Expand Up @@ -2741,9 +2738,7 @@ function interface_6rd_configure($interface = 'wan', $wancfg)
$rd6brgw = "{$rd6prefix_isp}{$wancfg['gateway-6rd']}";

$stfiface = "{$interface}_stf";
if (does_interface_exist($stfiface)) {
legacy_interface_destroy($stfiface);
}
legacy_interface_destroy($stfiface);
legacy_interface_create('stf', $stfiface);
legacy_interface_flags($stfiface, 'link2');

Expand Down Expand Up @@ -2839,9 +2834,7 @@ function interface_6to4_configure($interface = 'wan', $wancfg)
$stflan = Net_IPv6::compress(implode(":", $stflanarr));

$stfiface = "{$interface}_stf";
if (does_interface_exist($stfiface)) {
legacy_interface_destroy($stfiface);
}
legacy_interface_destroy($stfiface);
legacy_interface_create('stf', $stfiface);
legacy_interface_flags($stfiface, 'link2');

Expand Down
4 changes: 1 addition & 3 deletions src/www/interfaces_vlan.php
Expand Up @@ -42,9 +42,7 @@
if (is_interface_assigned($a_vlans[$id]['vlanif'])) {
$input_errors[] = gettext("This VLAN cannot be deleted because it is assigned as an interface.");
} else {
if (does_interface_exist($a_vlans[$id]['vlanif'])) {
legacy_interface_destroy($a_vlans[$id]['vlanif']);
}
legacy_interface_destroy($a_vlans[$id]['vlanif']);
unset($a_vlans[$id]);
write_config();
header(url_safe('Location: /interfaces_vlan.php'));
Expand Down

0 comments on commit 84cd38a

Please sign in to comment.