]> xenbits.xensource.com Git - xen.git/commitdiff
xm-test: fix the ip allocation function
authorZhu Yanhai <zhu.yanhai@gmail.com>
Mon, 30 Sep 2013 08:12:10 +0000 (16:12 +0800)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 3 Oct 2013 12:43:23 +0000 (13:43 +0100)
__findFirstOctetIP() is expecting min and max available octets according to
its code, however the caller getFreeIP() gives it the min octet and (max -
min + 1), which is the length instead.

Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/xm-test/lib/XmTestLib/NetConfig.py

index 1f834cc95a890b98ce945b1fdfa0976d0d791b83..5013befdfd3f93f7994c789ba338c97111a6f834 100644 (file)
@@ -159,7 +159,8 @@ class NetConfig:
     def setUsedIP(self, domname, interface, ip):
         self.used_ips['%s:%s' % (domname, interface)] = ip
 
-    def __findFirstOctetIP(self, prefix, min, max):
+    def __findFirstOctetIP(self, prefix, min, len):
+        max = min + len
         for i in range(min, max):
             ip = '%s%s' % (prefix, str(i))
             found = False