From: Joakim Tjernlund Date: Wed, 24 Sep 2008 16:15:48 +0000 (+0100) Subject: [ospfd] Fix SEGV during startup introduced in recent commit X-Git-Tag: frr-2.0-rc1~2356 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6e687d74f74f36bc9d503e29377e7d42f3427221;p=matthieu%2Ffrr.git [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 --- diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 32580ccf1d..c951a29a84 100644 --- a/ospfd/ospfd.c +++ b/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. */