[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xm-test: fix the ip allocation function



__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@xxxxxxxxxx>
---
 tools/xm-test/lib/XmTestLib/NetConfig.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py 
b/tools/xm-test/lib/XmTestLib/NetConfig.py
index 1f834cc..5013bef 100644
--- a/tools/xm-test/lib/XmTestLib/NetConfig.py
+++ b/tools/xm-test/lib/XmTestLib/NetConfig.py
@@ -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
-- 
1.7.4.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.