This commit is contained in:
brent s. 2020-05-15 03:20:04 -04:00
parent c877868c33
commit 51dadf421e
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -145,6 +145,16 @@ class TunnelBroker(object):
for assignment in self.tun.assignments:
for a in assignment.iface_addrs:
# The interface-specific ":1" addrs.
# Try to remove first in case it's already assigned.
try:
ipr.addr('del',
index = assignment.iface_idx,
address = a.str,
mask = a.prefix,
family = socket.AF_INET6)
logger.debug('Removed {0} with prefix {1} from {2}.'.format(a.str, a.prefixlen, assignment.iface))
except Exception as e:
pass
try:
ipr.addr('add',
index = assignment.iface_idx,
@ -159,13 +169,14 @@ class TunnelBroker(object):
raise e
# The SLAAC prefixes.
for b in assignment.iface_blocks:
# Try to remove first in case it's already assigned.
try:
ipr.addr('del',
index = assignment.iface_idx,
address = b.str,
address = str(b),
mask = b.prefixlen,
family = socket.AF_INET6)
logger.debug('Removed {0} with prefix {1} from {2}.'.format(b.str, b.prefixlen, assignment.iface))
logger.debug('Removed {0} with prefix {1} from {2}.'.format(str(b), b.prefixlen, assignment.iface))
except Exception as e:
pass
try: