From 73c30f1baa850d6a863849bca0ff84f7f04ad0b5 Mon Sep 17 00:00:00 2001 From: Stefania Date: Wed, 8 Feb 2017 16:01:34 +0000 Subject: [PATCH] CLOUDSTACK-9793: Faster ip in subnet check This change removes an unnecessary conversion from IPNetwork to list in one of the router scripts. This makes the router faster at processing static NAT rules, which can prevent timeouts when attaching or detaching IPs. (cherry picked from commit d5c5eb10f8a4fb80aa8b9182290948755cdd6026) Signed-off-by: Rohit Yadav --- systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py index e0eb350ead0..efe0d6f7e93 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py @@ -145,7 +145,7 @@ class CsInterface: def ip_in_subnet(self, ip): ipo = IPAddress(ip) net = IPNetwork("%s/%s" % (self.get_ip(), self.get_size())) - return ipo in list(net) + return ipo in net def get_gateway_cidr(self): return "%s/%s" % (self.get_gateway(), self.get_size())