diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2022-11-07 11:03:41 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2022-11-10 15:11:53 +0100 |
| commit | e5309c1a6e366f5dc95cbc3bbbe5c7ce1d46625c (patch) | |
| tree | 94b1abf7d663e6240029aa87f559f52cdd0ab292 | |
| parent | ac8aa2f7ca24412791e9313fdef7fddbf7b5c9ef (diff) | |
ospfd: prevent from crashing when processing external lsa
When using debug mode, the ei parameter may be NULL. In that
case, do not display the log trace, otherwise a crash will
happen.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| -rw-r--r-- | ospfd/ospf_lsa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 4fb3a33568..a67b6c6c19 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2205,7 +2205,7 @@ struct ospf_lsa *ospf_external_lsa_originate(struct ospf *ospf, */ if (ospf->router_id.s_addr == INADDR_ANY) { - if (IS_DEBUG_OSPF_EVENT) + if (ei && IS_DEBUG_OSPF_EVENT) zlog_debug( "LSA[Type5:%pI4]: deferring AS-external-LSA origination, router ID is zero", &ei->p.prefix); @@ -2214,7 +2214,7 @@ struct ospf_lsa *ospf_external_lsa_originate(struct ospf *ospf, /* Create new AS-external-LSA instance. */ if ((new = ospf_external_lsa_new(ospf, ei, NULL)) == NULL) { - if (IS_DEBUG_OSPF_EVENT) + if (ei && IS_DEBUG_OSPF_EVENT) zlog_debug( "LSA[Type5:%pI4]: Could not originate AS-external-LSA", &ei->p.prefix); |
