Citycom OAN: Always using last ctag for mgmt

This commit is contained in:
Frank Schubert
2025-11-26 15:20:36 +01:00
parent 2b825364ab
commit aeb0373cf5
3 changed files with 27 additions and 8 deletions
+13 -4
View File
@@ -734,15 +734,22 @@ class Preorder extends mfBaseModel {
// get start of ctag range
$first_ctag = $search_ctag - ($search_ctag % $ctags_per_home);
$last_ctag = $first_ctag + $ctags_per_home - 1;
$mgmt_ctag = null;
$ctag_range = [];
for($i = $first_ctag; $i < $first_ctag + $ctags_per_home; $i++) {
for($i = $first_ctag; $i <= $last_ctag; $i++) {
if(!PreorderCtag::getFirstActive(["stag" => $stag, "ctag" => $i, "network" => $network_name])) {
if($i == $last_ctag) {
// mgmt ctag should be the last in range
$mgmt_ctag = $i;
continue;
}
$ctag_range[] = $i;
}
}
}
return $ctag_range;
return [$ctag_range, $mgmt_ctag];
}
public function getNextFreeCtags() {
@@ -790,7 +797,9 @@ class Preorder extends mfBaseModel {
$new_ctags[] = $i;
}
return $new_ctags;
$mgmt_ctag = array_pop($new_ctags);
return [$new_ctags, $mgmt_ctag];
}
public function setOrCreateOaid($oaid_attributes = false) {