summaryrefslogtreecommitdiff
path: root/ospfd/ospfd.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <ajschorr@alumni.princeton.edu>2007-02-27 13:55:46 +0000
committerAndrew J. Schorr <ajschorr@alumni.princeton.edu>2007-02-27 13:55:46 +0000
commit4056a544eb0b7ea513bca0d70808e671c3f2c25b (patch)
treed5e3ecf637a6ac20215a33e100b63c41eb6c53df /ospfd/ospfd.c
parentbd34fb346db5bb1f0bc8eeeef1868e296d889053 (diff)
[ospfd] Fix bug: should exit immediately on SIGTERM if OSPF not actually running
2007-02-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * ospfd.c: (ospf_terminate) Exit immediately if ospf is not actually running (e.g. the config file was empty). Fixes bug where SIGTERM would not kill ospfd.
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r--ospfd/ospfd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index f72295d1..159422b4 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -355,6 +355,10 @@ ospf_terminate (void)
SET_FLAG (om->options, OSPF_MASTER_SHUTDOWN);
+ /* exit immediately if OSPF not actually running */
+ if (listcount(om->ospf) == 0)
+ exit(0);
+
for (ALL_LIST_ELEMENTS (om->ospf, node, nnode, ospf))
ospf_finish (ospf);