From d5c5eb10f8a4fb80aa8b9182290948755cdd6026 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. --- 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 a16fd071613..66f0fa13966 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())