Commit c3030dfc authored by Julien Muchembled's avatar Julien Muchembled

Fix cleanup on exit when Babel exits prematurely

parent c2a5607c
...@@ -179,13 +179,13 @@ def main(): ...@@ -179,13 +179,13 @@ def main():
tunnel_manager = write_pipe = None tunnel_manager = write_pipe = None
config.babel_args += config.iface_list config.babel_args += config.iface_list
router = plib.router(network, utils.ipFromBin(subnet), len(subnet), cleanup = [plib.router(network, utils.ipFromBin(subnet), len(subnet),
config.hello, os.path.join(config.log, 'babeld.log'), config.hello, os.path.join(config.log, 'babeld.log'),
os.path.join(config.state, 'babeld.state'), os.path.join(config.state, 'babeld.state'),
config.babel_pidfile, tunnel_interfaces, *config.babel_args) config.babel_pidfile, tunnel_interfaces,
*config.babel_args).terminate]
try: try:
cleanup = []
my_network = "%s/%u" % (utils.ipFromBin(network), len(network)) my_network = "%s/%u" % (utils.ipFromBin(network), len(network))
ip('route', 'unreachable', my_network, 'proto', 'static') ip('route', 'unreachable', my_network, 'proto', 'static')
# Source address selection is defined by RFC 3484, and in most # Source address selection is defined by RFC 3484, and in most
...@@ -251,7 +251,6 @@ def main(): ...@@ -251,7 +251,6 @@ def main():
if forwarder and t >= forwarder.next_refresh: if forwarder and t >= forwarder.next_refresh:
forwarder.refresh() forwarder.refresh()
finally: finally:
router.terminate()
for cleanup in cleanup: for cleanup in cleanup:
try: try:
cleanup() cleanup()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment