2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-08-03 16:06:59 +00:00

Merge pull request #7683 from xcat2/backport-7617-to-2.18

[Backport 2.18] fix(dhcp): avoid infinite loop building IPv6 reverse zones
This commit is contained in:
xcat2-backport-automation[bot]
2026-07-24 15:26:29 +00:00
committed by GitHub
+7 -1
View File
@@ -3620,7 +3620,13 @@ sub getzonesfornet {
$rev .= $_ . ".";
$nibbs--;
}
while ($nibbs) {
if ($nibbs < 0) {
# a sub-nibble (not 4-bit-aligned) IPv6 mask leaves $nibbs negative;
# bail rather than spin forever in the loop below. $nibbs == 0 is the
# normal nibble-aligned case (e.g. a /64) and must still emit a zone.
return ();
}
while ($nibbs > 0) {
$rev .= "0.";
$nibbs--;
}