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

[Xen-changelog] [xen master] xm-test: fix the ip allocation function



commit c8f5eb4b8093ac6acc947a4df5779e69005d16c4
Author:     Zhu Yanhai <zhu.yanhai@xxxxxxxxx>
AuthorDate: Mon Sep 30 16:12:10 2013 +0800
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Oct 3 13:43:23 2013 +0100

    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>
    Acked-by: Ian Campbell <ian.campbell@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
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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