From: jardin Date: Wed, 2 Mar 2005 22:43:26 +0000 (+0000) Subject: Fix segfault when ospf6_create() is not called yet. X-Git-Tag: frr-2.0-rc1~3160 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c1ba9e8a8ac0447e6f33d50b4b9e7a1e68307bf1;p=mirror%2Ffrr.git Fix segfault when ospf6_create() is not called yet. Thanks to Mohit Thakur. --- diff --git a/ospf6d/ChangeLog b/ospf6d/ChangeLog index 38c74dc2c4..60519e64c4 100644 --- a/ospf6d/ChangeLog +++ b/ospf6d/ChangeLog @@ -1,3 +1,9 @@ +2005-03-02 Vincent Jardin + + * ospf6_zebra.c: Fix core dump when router-id is provided with + an empty ospf6d.conf file (no context router ospf6) because + ospf6_create has not been called yet. + 2005-01-25 Paul Jakma * ospf6_asbr.c: Add "hsls" to the zroute_name const char array. diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index bdd3babcc7..bc15dff661 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -57,6 +57,9 @@ ospf6_router_id_update_zebra (int command, struct zclient *zclient, zebra_router_id_update_read(zclient->ibuf,&router_id); router_id_zebra = router_id.u.prefix4; + if (o == NULL) + return 0; + if (o->router_id == 0) o->router_id = (u_int32_t) router_id_zebra.s_addr;