mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-22 00:49:30 +00:00
Merge pull request #7617 from VersatusHPC/harvest/dhcp-ipv6-infinite-loop
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