diff options
author | hasso <hasso> | 2005-09-16 14:44:23 +0000 |
---|---|---|
committer | hasso <hasso> | 2005-09-16 14:44:23 +0000 |
commit | a96d8d1095da09811e343a534f5801a948ae1061 (patch) | |
tree | 572fdf17817de64a85cda87d15f3b0da8640c6b5 /isisd/isis_lsp.c | |
parent | 53a6f932032a30625358414ae0f77790656ccaca (diff) |
* isis_lsp.c (lsp_update): Remove LSP from database before updating
its data and put it back after. Database entry MUST contain at least
correct pointers to the sysid to get correct compare results.
* isis_lsp.[ch], isis_pdu.c: Pass level to the lsp_update() function.
Diffstat (limited to 'isisd/isis_lsp.c')
-rw-r--r-- | isisd/isis_lsp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 2a9d1465..d147c650 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -416,8 +416,14 @@ lsp_update_data (struct isis_lsp *lsp, struct stream *stream, void lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr, - struct stream *stream, struct isis_area *area) + struct stream *stream, struct isis_area *area, int level) { + dnode_t *dnode; + + /* 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)); + /* free the old lsp data */ XFREE (MTYPE_STREAM_DATA, lsp->pdu); lsp_clear_data (lsp); @@ -427,6 +433,9 @@ 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]); } /* creation of LSP directly from what we received */ |