]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: lp may be null, make sure it isn't
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 1 Jun 2018 00:55:59 +0000 (20:55 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 5 Jun 2018 14:42:05 +0000 (10:42 -0400)
We lookup the lp value and lookup_linkparams_by_instance
can return NULL if something has gone terribly wrong.
Make sure that lp is not NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd/ospf_te.c

index 26df7a24cd1736b66dfb2a007d8d3bfadb0d7901..2b1b328617e31e1c1ef034095b0da3eb5e68eae6 100644 (file)
@@ -1451,6 +1451,8 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
                zlog_warn("ospf_mpls_te_lsa_refresh: Invalid parameter?");
                lsa->data->ls_age =
                        htons(OSPF_LSA_MAXAGE); /* Flush it anyway. */
+               ospf_opaque_lsa_flush_schedule(lsa);
+               return NULL;
        }
 
        /* Check if lp was not disable in the interval */
@@ -1463,8 +1465,7 @@ static struct ospf_lsa *ospf_mpls_te_lsa_refresh(struct ospf_lsa *lsa)
 
        /* If the lsa's age reached to MaxAge, start flushing procedure. */
        if (IS_LSA_MAXAGE(lsa)) {
-               if (lp)
-                       UNSET_FLAG(lp->flags, LPFLG_LSA_ENGAGED);
+               UNSET_FLAG(lp->flags, LPFLG_LSA_ENGAGED);
                ospf_opaque_lsa_flush_schedule(lsa);
                return NULL;
        }