there we go. route cleanup sorted.

This commit is contained in:
brent s. 2020-05-10 06:19:48 -04:00
parent 4cee007203
commit b1456ae16a
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
1 changed files with 5 additions and 4 deletions

View File

@ -196,15 +196,16 @@ class TunnelBroker(object):
except Exception as e:
logger.error('Could not set iface_idx for link {0}: {1}'.format(self.iface_name, e))
raise e
try:
self.ipr.link('set', index = self.iface_idx, state = 'down')
except Exception as e:
logger.error('Could not bring down link {0}: {1} (continuing anyways)'.format(self.iface_name, e))
try:
self.ipr.route('del', dst = 'default', oif = self.iface_idx, family = socket.AF_INET6)
logger.debug('Removed default route for link {0}.'.format(self.iface_name))
except Exception as e:
logger.error(('Could not remove default IPv6 route on link {0}: '
'{1} (continuing anyways)').format(self.iface_name, e))
try:
self.ipr.link('set', index = self.iface_idx, state = 'down')
except Exception as e:
logger.error('Could not bring down link {0}: {1} (continuing anyways)'.format(self.iface_name, e))
try:
self.ipr.link('del', index = self.iface_idx)
logger.debug('Deleted link {0}.'.format(self.iface_name))