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:
@@ -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--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user