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.
This commit is contained in:
Stefania 2017-02-08 16:01:34 +00:00 committed by jeff
parent d84347ba8c
commit d5c5eb10f8
1 changed files with 1 additions and 1 deletions

View File

@ -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())