mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
ifreload: address module always reconfigures (dels/adds) addresses when user
Ticket: CM-8561 Reviewed By: kanna, julien Testing Done: Tested on amd64 switch ifreload always deletes and adds back a host IP address if that address is specified without a "/" and without a "netmask" config. The problem is fixed so that _inet_address_convert_to_cidr() handles a missing "/" and a missing "netmask" config. The host addresses is no longer added to a list of addresses we will del/add. The patch was simply to add a case for the missing "/" and a missing "netmask".
This commit is contained in:
committed by
Julien Fortin
parent
e367482f2e
commit
42ae783899
@@ -153,6 +153,11 @@ class address(moduleBase):
|
||||
prefixlen = IPNetwork('%s' %addr +
|
||||
'/%s' %netmask).prefixlen
|
||||
newaddr = addr + '/%s' %prefixlen
|
||||
else:
|
||||
# we are here because there is no slash (/xx) and no netmask
|
||||
# just let IPNetwork handle the ipv4 or ipv6 address mask
|
||||
prefixlen = IPNetwork(addr).prefixlen
|
||||
newaddr = addr + '/%s' %prefixlen
|
||||
newaddrs.append(newaddr)
|
||||
|
||||
attrs = {}
|
||||
|
||||
Reference in New Issue
Block a user