Browse Source

[ospfd] Fix SEGV during startup introduced in recent commit

* ospfd/ospfd.c: (opsf_if_update) Check if ospf_lookup() returns NULL.
  Fixes bug introduced with recent ospf_network_run changes in
  a49eb30a, where SEGV will happen if not the "router ospf" command has
  been executed before the first interfaces are reported by zebra.

Signed-off-by: Paul Jakma <paul@quagga.net>
Joakim Tjernlund 13 years ago
parent
commit
6e687d74f7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ospfd/ospfd.c

+ 2 - 2
ospfd/ospfd.c

@@ -998,8 +998,8 @@ ospf_if_update (struct ospf *ospf, struct interface *ifp)
   if (!ospf)
     ospf = ospf_lookup ();
 
-  /* Router-ID must be configured. */
-  if (ospf->router_id.s_addr == 0)
+  /* OSPF must be on and Router-ID must be configured. */
+  if (!ospf || ospf->router_id.s_addr == 0)
     return;
   
   /* Run each netowrk for this interface. */