]> git.puffer.fish Git - mirror/frr.git/commitdiff
* isis_lsp.c (lsp_update): Fix previous commit - manipulate the right
authorhasso <hasso>
Sun, 18 Sep 2005 17:51:02 +0000 (17:51 +0000)
committerhasso <hasso>
Sun, 18 Sep 2005 17:51:02 +0000 (17:51 +0000)
  database and only if LSP is really in the database (sanity check).

isisd/ChangeLog
isisd/isis_lsp.c

index 6a2be9401012f084af7117517f63be975c525f6a..d9e65bbdf125e4204436ec22c491ca87fcdfa6a2 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-18 Hasso Tepper <hasso at quagga.net>
+
+       * isis_lsp.c (lsp_update): Fix previous commit - manipulate the right
+         database and only if LSP is really in the database (sanity check).
+
 2005-09-16 Hasso Tepper <hasso at quagga.net>
 
        * isis_lsp.c (lsp_update): Remove LSP from database before updating
index d147c650bad26e1e5ccf8383fb5856eea1e06b98..a294bc8f0c464c2e3ebf95121c01edf9d02ff894 100644 (file)
@@ -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 */