]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_spf_private.h
[7.2]bgpd: Prevent crash in bgp_table_range_lookup (#5454)
[mirror_frr.git] / isisd / isis_spf_private.h
index 131fa37991a92baa9594b260cf4290f31c39f3eb..a8185a8be0fec76b0a5170457d87d453e9f9d503 100644 (file)
@@ -79,9 +79,9 @@ struct isis_vertex_queue {
 };
 
 __attribute__((__unused__))
-static unsigned isis_vertex_queue_hash_key(void *vp)
+static unsigned isis_vertex_queue_hash_key(const void *vp)
 {
-       struct isis_vertex *vertex = vp;
+       const struct isis_vertex *vertex = vp;
 
        if (VTYPE_IP(vertex->type)) {
                uint32_t key;
@@ -95,16 +95,16 @@ static unsigned isis_vertex_queue_hash_key(void *vp)
 }
 
 __attribute__((__unused__))
-static int isis_vertex_queue_hash_cmp(const void *a, const void *b)
+static bool isis_vertex_queue_hash_cmp(const void *a, const void *b)
 {
        const struct isis_vertex *va = a, *vb = b;
 
        if (va->type != vb->type)
-               return 0;
+               return false;
 
        if (VTYPE_IP(va->type)) {
                if (prefix_cmp(&va->N.ip.dest, &vb->N.ip.dest))
-                       return 0;
+                       return false;
 
                return prefix_cmp((const struct prefix *)&va->N.ip.src,
                                  (const struct prefix *)&vb->N.ip.src) == 0;
@@ -347,8 +347,8 @@ static struct isis_lsp *lsp_for_vertex(struct isis_spftree *spftree,
        memcpy(lsp_id, vertex->N.id, ISIS_SYS_ID_LEN + 1);
        LSP_FRAGMENT(lsp_id) = 0;
 
-       dict_t *lspdb = spftree->area->lspdb[spftree->level - 1];
-       struct isis_lsp *lsp = lsp_search(lsp_id, lspdb);
+       struct lspdb_head *lspdb = &spftree->area->lspdb[spftree->level - 1];
+       struct isis_lsp *lsp = lsp_search(lspdb, lsp_id);
 
        if (lsp && lsp->hdr.rem_lifetime != 0)
                return lsp;