Skip to content

Commit 85ea9d4

Browse files
Fixed #7231
This avoids the problem rather than fixing it by requiring the user to remove any queues from the if before deleting
1 parent 6378ef4 commit 85ea9d4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/etc/inc/shaper.inc

+14
Original file line numberDiff line numberDiff line change
@@ -4647,4 +4647,18 @@ $shaper_msg = gettext("Buttons at the bottom represent %s actions and are activa
46474647
$default_shaper_msg .= sprintf($shaper_msg, gettext("queue"));
46484648
$dn_default_shaper_msg .= sprintf($shaper_msg, gettext("limiter"));
46494649

4650+
// Check to see if the specified interface has a queue configured
4651+
function interface_has_queue($if) {
4652+
global $config;
4653+
4654+
if ($config['shaper']) {
4655+
foreach ($config['shaper']['queue'] as $queue) {
4656+
if ($queue['interface'] === $if) {
4657+
return true;
4658+
}
4659+
}
4660+
}
4661+
4662+
return false;
4663+
}
46504664
?>

src/usr/local/www/interfaces_assign.php

+2
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ interface_configure($ifname, true);
388388
$input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue");
389389
} else if (link_interface_to_gif($id)) {
390390
$input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue");
391+
} else if (interface_has_queue($id)) {
392+
$input_errors[] = gettext("The interface has a traffic shaper queue configured.\nPlease emove all queues on the interface to continue.\n");
391393
} else {
392394
unset($config['interfaces'][$id]['enable']);
393395
$realid = get_real_interface($id);

0 commit comments

Comments
 (0)