summaryrefslogtreecommitdiffstats
path: root/isisd/isis_lsp.c
diff options
context:
space:
mode:
authorhasso <hasso>2005-09-18 19:51:02 +0200
committerhasso <hasso>2005-09-18 19:51:02 +0200
commit4eda93ab0bb51da95f239b9e7eaecf8487ef4424 (patch)
tree4913dafddd31a0c2e16e6887d01179982e3d6fcf /isisd/isis_lsp.c
parent2005-09-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu> (diff)
downloadfrr-4eda93ab0bb51da95f239b9e7eaecf8487ef4424.tar.xz
frr-4eda93ab0bb51da95f239b9e7eaecf8487ef4424.zip
* isis_lsp.c (lsp_update): Fix previous commit - manipulate the right
database and only if LSP is really in the database (sanity check).
Diffstat (limited to '')
-rw-r--r--isisd/isis_lsp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index d147c650b..a294bc8f0 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -418,11 +418,12 @@ void
lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr,
struct stream *stream, struct isis_area *area, int level)
{
- dnode_t *dnode;
+ dnode_t *dnode = NULL;
/* Remove old LSP from LSP database. */
- dnode = dict_lookup (area->lspdb[level], lsp->lsp_header->lsp_id);
- dnode_destroy (dict_delete (area->lspdb[level], dnode));
+ dnode = dict_lookup (area->lspdb[level - 1], lsp->lsp_header->lsp_id);
+ if (dnode)
+ dnode_destroy (dict_delete (area->lspdb[level - 1], dnode));
/* free the old lsp data */
XFREE (MTYPE_STREAM_DATA, lsp->pdu);
@@ -434,8 +435,8 @@ lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr,
/* set the new values for lsp header */
memcpy (lsp->lsp_header, lsp_hdr, ISIS_LSP_HDR_LEN);
- /* Put LSP back into LSP database, now with updated data. */
- lsp_insert (lsp, area->lspdb[level]);
+ if (dnode)
+ lsp_insert (lsp, area->lspdb[level - 1]);
}
/* creation of LSP directly from what we received */