Skip to content

Commit

Permalink
Only check for limiter name conflicts if the name changed. Fix #15990
Browse files Browse the repository at this point in the history
While here, rename the variable $queue to $subqueue for clarity.
  • Loading branch information
marcos-ng committed Jan 13, 2025
1 parent 48b2525 commit 6bf3e08
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/usr/local/www/firewall_shaper_vinterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@
if (!is_array($dn->subqueues) || empty($dn->subqueues)) {
continue;
}
foreach ($dn->subqueues as $queue) {
if ($queue->GetQname() == $newname) {
foreach ($dn->subqueues as $subqueue) {
if ($subqueue->GetQname() == $newname) {
$input_errors[] = gettext("Limiters and child queues cannot have the same name.");
break 2;
}
Expand Down Expand Up @@ -295,12 +295,15 @@
}

} else if ($queue) {
foreach ($dummynet_pipe_list as $dn) {
if ($dn->GetQname() == $newname) {
$input_errors[] = gettext("Limiters and child queues cannot have the same name.");
break;
if ($queue->GetQname() != $newname) {
foreach ($dummynet_pipe_list as $dn) {
if ($dn->GetQname() == $newname) {
$input_errors[] = gettext("Limiters and child queues cannot have the same name.");
break;
}
}
}

if (!$input_errors) {
$queue->validate_input($_POST, $input_errors);
}
Expand Down

0 comments on commit 6bf3e08

Please sign in to comment.