From 0e070cd2fd4bbff31c3886e70aaed2319911cc37 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 5 Mar 2018 13:47:49 -0500 Subject: [PATCH] Fix infinite loop if unfortunate IPv6 encountered --- xCAT-server/lib/xcat/plugins/dhcp.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 503d1e7fe..1d3c2bfd2 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2187,7 +2187,10 @@ sub getzonesfornet { $rev .= $_ . "."; $nibbs--; } - while ($nibbs) { + if ($nibbs < 1) { + return (); # Don't presume to handle maskless subnets... + } + while ($nibbs > 0) { $rev .= "0."; $nibbs--; }