* 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.
This commit is contained in:
hasso 2005-09-16 14:44:23 +00:00
parent 53a6f93203
commit a96d8d1095
4 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2005-09-16 Hasso Tepper <hasso at quagga.net>
* 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.
2005-09-05 Hasso Tepper <hasso at quagga.net> 2005-09-05 Hasso Tepper <hasso at quagga.net>
* *.c: Try to be less verbose by default (without any debug options * *.c: Try to be less verbose by default (without any debug options

View File

@ -416,8 +416,14 @@ lsp_update_data (struct isis_lsp *lsp, struct stream *stream,
void void
lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr, 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 */ /* free the old lsp data */
XFREE (MTYPE_STREAM_DATA, lsp->pdu); XFREE (MTYPE_STREAM_DATA, lsp->pdu);
lsp_clear_data (lsp); 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 */ /* set the new values for lsp header */
memcpy (lsp->lsp_header, lsp_hdr, ISIS_LSP_HDR_LEN); 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 */ /* creation of LSP directly from what we received */

View File

@ -114,7 +114,7 @@ int lsp_id_cmp (u_char * id1, u_char * id2);
int lsp_compare (char *areatag, struct isis_lsp *lsp, u_int32_t seq_num, int lsp_compare (char *areatag, struct isis_lsp *lsp, u_int32_t seq_num,
u_int16_t checksum, u_int16_t rem_lifetime); u_int16_t checksum, u_int16_t rem_lifetime);
void lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr, 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);
void lsp_inc_seqnum (struct isis_lsp *lsp, u_int32_t seq_num); void lsp_inc_seqnum (struct isis_lsp *lsp, u_int32_t seq_num);
int lsp_print_all (struct vty *vty, dict_t * lspdb, char detail, int lsp_print_all (struct vty *vty, dict_t * lspdb, char detail,
char dynhost); char dynhost);

View File

@ -1085,7 +1085,8 @@ dontcheckadj:
/* 7.3.16.4 b) 1) */ /* 7.3.16.4 b) 1) */
if (comp == LSP_NEWER) if (comp == LSP_NEWER)
{ {
lsp_update (lsp, hdr, circuit->rcv_stream, circuit->area); lsp_update (lsp, hdr, circuit->rcv_stream, circuit->area,
level);
/* ii */ /* ii */
ISIS_FLAGS_SET_ALL (lsp->SRMflags); ISIS_FLAGS_SET_ALL (lsp->SRMflags);
/* iii */ /* iii */
@ -1239,7 +1240,7 @@ dontcheckadj:
else if (comp == LSP_EQUAL) else if (comp == LSP_EQUAL)
{ {
ISIS_CLEAR_FLAG (lsp->SRMflags, circuit); ISIS_CLEAR_FLAG (lsp->SRMflags, circuit);
lsp_update (lsp, hdr, circuit->rcv_stream, circuit->area); lsp_update (lsp, hdr, circuit->rcv_stream, circuit->area, level);
if (circuit->circ_type != CIRCUIT_T_BROADCAST) if (circuit->circ_type != CIRCUIT_T_BROADCAST)
{ {
ISIS_SET_FLAG (lsp->SSNflags, circuit); ISIS_SET_FLAG (lsp->SSNflags, circuit);