diff options
author | paul <paul> | 2006-06-15 12:04:57 +0000 |
---|---|---|
committer | paul <paul> | 2006-06-15 12:04:57 +0000 |
commit | 990176da39114574975e946faa2bd76957ac2d87 (patch) | |
tree | db957d9657bd7e70fefd767fc09c30b31bd55364 /ospfd/ospf_lsdb.c | |
parent | 02c4efcb9efc7df2988f27b009444aeec0815abc (diff) | |
download | quagga-990176da39114574975e946faa2bd76957ac2d87.tar.bz2 quagga-990176da39114574975e946faa2bd76957ac2d87.tar.xz |
[ospfd] lsdb_delete/discard_from_db should be more robust to bad args
2006-05-31 Paul Jakma <paul.jakma@sun.com>
* ospf_lsdb.c: (ospf_lsdb_delete) robustify against NULL arguments,
print warning.
* ospf_lsa.c: (ospf_discard_from_db) ditto.
(ospf_maxage_lsa_remover) Check lsa->lsdb for validity, possible
mitigation (but not solution) for bug #269.
Diffstat (limited to 'ospfd/ospf_lsdb.c')
-rw-r--r-- | ospfd/ospf_lsdb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c index c0ec4b3d..b161b806 100644 --- a/ospfd/ospf_lsdb.c +++ b/ospfd/ospf_lsdb.c @@ -127,6 +127,22 @@ ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_lsa *lsa) struct prefix_ls lp; struct route_node *rn; + if (!lsdb) + { + zlog_warn ("%s: Called with NULL LSDB", __func__); + if (lsa) + zlog_warn ("LSA[Type%d:%s]: LSA %p, lsa->lsdb %p", + lsa->data->type, inet_ntoa (lsa->data->id), + lsa, lsa->lsdb); + return; + } + + if (!lsa) + { + zlog_warn ("%s: Called with NULL LSA", __func__); + return; + } + table = lsdb->type[lsa->data->type].db; lsdb_prefix_set (&lp, lsa); rn = route_node_lookup (table, (struct prefix *) &lp); |