__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>
---
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
On Mon, 2013-09-30 at 16:12 +0800, Zhu Yanhai wrote:> __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.The code is pretty opaque, but I agree, the elements of free_oct_ips, which is ultimately what gets passed here, are initialised as (int(maxo[3]) - int(mino[3])) + 1> Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com>Acked + applied, thanks.
Possibly Parallel Threads
- [PATCH] xm,xend: flesh out xm sched-sedf
- [PATCH] [Xm-Test] A test case doing local migration 3 times in a loop
- [PATCH][XM-TEST] Fix bugzilla # 674 by changing the xm-test Console.py to wait for the command prompt.
- [PATCH] nr_cpus calculation problem due to incorrect sockets_per_node
- Xen PV ABI on FPU doesn't match with pvops kernel FPU code, reducing to a serious memory data damage