]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_lsdb.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / ospf6d / ospf6_lsdb.c
index 8764a549d2572f084762198d007bdcb240e71f4e..5e02c0c917b66471931a6626bb32395acea53275 100644 (file)
@@ -83,8 +83,7 @@ static void _lsdb_count_assert(struct ospf6_lsdb *lsdb)
        zlog_debug("PANIC !! lsdb[%p]->count = %d, real = %d", lsdb,
                   lsdb->count, num);
        for (ALL_LSDB(lsdb, debug))
-               zlog_debug("%p %p %s lsdb[%p]", debug->prev, debug->next,
-                          debug->name, debug->lsdb);
+               zlog_debug("%s lsdb[%p]", debug->name, debug->lsdb);
        zlog_debug("DUMP END");
 
        assert(num == lsdb->count);
@@ -174,8 +173,8 @@ void ospf6_lsdb_remove(struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb)
        ospf6_lsdb_count_assert(lsdb);
 }
 
-struct ospf6_lsa *ospf6_lsdb_lookup(u_int16_t type, u_int32_t id,
-                                   u_int32_t adv_router,
+struct ospf6_lsa *ospf6_lsdb_lookup(uint16_t type, uint32_t id,
+                                   uint32_t adv_router,
                                    struct ospf6_lsdb *lsdb)
 {
        struct route_node *node;
@@ -197,8 +196,8 @@ struct ospf6_lsa *ospf6_lsdb_lookup(u_int16_t type, u_int32_t id,
        return (struct ospf6_lsa *)node->info;
 }
 
-struct ospf6_lsa *ospf6_lsdb_lookup_next(u_int16_t type, u_int32_t id,
-                                        u_int32_t adv_router,
+struct ospf6_lsa *ospf6_lsdb_lookup_next(uint16_t type, uint32_t id,
+                                        uint32_t adv_router,
                                         struct ospf6_lsdb *lsdb)
 {
        struct route_node *node;
@@ -335,6 +334,7 @@ int ospf6_lsdb_maxage_remover(struct ospf6_lsdb *lsdb)
                }
                if (IS_OSPF6_DEBUG_LSA_TYPE(lsa->header->type))
                        zlog_debug("Remove MaxAge %s", lsa->name);
+
                if (CHECK_FLAG(lsa->flag, OSPF6_LSA_SEQWRAPPED)) {
                        UNSET_FLAG(lsa->flag, OSPF6_LSA_SEQWRAPPED);
                        /*
@@ -355,7 +355,7 @@ int ospf6_lsdb_maxage_remover(struct ospf6_lsdb *lsdb)
 }
 
 void ospf6_lsdb_show(struct vty *vty, enum ospf_lsdb_show_level level,
-                    u_int16_t *type, u_int32_t *id, u_int32_t *adv_router,
+                    uint16_t *type, uint32_t *id, uint32_t *adv_router,
                     struct ospf6_lsdb *lsdb)
 {
        struct ospf6_lsa *lsa;
@@ -392,8 +392,7 @@ void ospf6_lsdb_show(struct vty *vty, enum ospf_lsdb_show_level level,
                ospf6_lsa_show_summary_header(vty);
 
        end = ospf6_lsdb_head(lsdb, !!type + !!(type && adv_router),
-                             type ? *type : 0,
-                             adv_router ? *adv_router : 0,
+                             type ? *type : 0, adv_router ? *adv_router : 0,
                              &lsa);
        while (lsa) {
                if ((!adv_router || lsa->header->adv_router == *adv_router)
@@ -404,11 +403,11 @@ void ospf6_lsdb_show(struct vty *vty, enum ospf_lsdb_show_level level,
        }
 }
 
-u_int32_t ospf6_new_ls_id(u_int16_t type, u_int32_t adv_router,
-                         struct ospf6_lsdb *lsdb)
+uint32_t ospf6_new_ls_id(uint16_t type, uint32_t adv_router,
+                        struct ospf6_lsdb *lsdb)
 {
        struct ospf6_lsa *lsa;
-       u_int32_t id = 1, tmp_id;
+       uint32_t id = 1, tmp_id;
 
        /* This routine is curently invoked only for Inter-Prefix LSAs for
         * non-summarized routes (no area/range).
@@ -425,13 +424,13 @@ u_int32_t ospf6_new_ls_id(u_int16_t type, u_int32_t adv_router,
                id++;
        }
 
-       return ((u_int32_t)htonl(id));
+       return ((uint32_t)htonl(id));
 }
 
 /* Decide new LS sequence number to originate.
    note return value is network byte order */
-u_int32_t ospf6_new_ls_seqnum(u_int16_t type, u_int32_t id,
-                             u_int32_t adv_router, struct ospf6_lsdb *lsdb)
+uint32_t ospf6_new_ls_seqnum(uint16_t type, uint32_t id, uint32_t adv_router,
+                            struct ospf6_lsdb *lsdb)
 {
        struct ospf6_lsa *lsa;
        signed long seqnum = 0;
@@ -443,5 +442,5 @@ u_int32_t ospf6_new_ls_seqnum(u_int16_t type, u_int32_t id,
        else
                seqnum = (signed long)ntohl(lsa->header->seqnum) + 1;
 
-       return ((u_int32_t)htonl(seqnum));
+       return ((uint32_t)htonl(seqnum));
 }