]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: Add missing enum's to switch statement
authorDonald Sharp <sharpd@nvidia.com>
Mon, 30 Jan 2023 15:08:47 +0000 (10:08 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 31 Jan 2023 20:15:42 +0000 (15:15 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
isisd/isis_adjacency.c
isisd/isis_pdu_counter.c
isisd/isis_spf.c
isisd/isis_te.c
isisd/isisd.c

index 0957c897e6caa64b7a687010fe3a5fb66f6ebdfd..a8878974032b4391077a895d659d83f6864d6a14 100644 (file)
@@ -484,9 +484,11 @@ const char *isis_adj_yang_state(enum isis_adj_state state)
                return "up";
        case ISIS_ADJ_INITIALIZING:
                return "init";
-       default:
+       case ISIS_ADJ_UNKNOWN:
                return "failed";
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 void isis_adj_expire(struct thread *thread)
@@ -954,8 +956,9 @@ int isis_adj_usage2levels(enum isis_adj_usage usage)
                return IS_LEVEL_2;
        case ISIS_ADJ_LEVEL1AND2:
                return IS_LEVEL_1 | IS_LEVEL_2;
-       default:
-               break;
+       case ISIS_ADJ_NONE:
+               return 0;
        }
-       return 0;
+
+       assert(!"Reached end of function where we are not expecting to");
 }
index ec2a0c207613bc70879a512cdf19b167b96f39c8..bc1a57ccffd5e45b0c8255ec82eff59937dc9ba6 100644 (file)
@@ -77,9 +77,11 @@ static const char *pdu_counter_index_to_name(enum pdu_counter_index index)
                return "L1 PSNP";
        case L2_PARTIAL_SEQ_NUM_INDEX:
                return "L2 PSNP";
-       default:
+       case PDU_COUNTER_SIZE:
                return "???????";
        }
+
+       assert(!"Reached end of function where we were not expecting to");
 }
 
 void pdu_counter_count(pdu_counter_t counter, uint8_t pdu_type)
index a6eef75e7e50c1c2c380e2cadf66fe83630b06c5..22625ed247111fc036d604f9e83cc27158a428e8 100644 (file)
@@ -1587,8 +1587,8 @@ static void spf_path_process(struct isis_spftree *spftree,
                vertex->N.ip.priority = priority;
                if (vertex->depth == 1 || listcount(vertex->Adj_N) > 0) {
                        struct isis_spftree *pre_spftree;
-                       struct route_table *route_table;
-                       bool allow_ecmp;
+                       struct route_table *route_table = NULL;
+                       bool allow_ecmp = false;
 
                        switch (spftree->type) {
                        case SPF_TYPE_RLFA:
@@ -1606,7 +1606,8 @@ static void spf_path_process(struct isis_spftree *spftree,
                                        return;
                                }
                                break;
-                       default:
+                       case SPF_TYPE_FORWARD:
+                       case SPF_TYPE_REVERSE:
                                break;
                        }
 
@@ -1624,7 +1625,8 @@ static void spf_path_process(struct isis_spftree *spftree,
                                pre_spftree->lfa.protection_counters
                                        .tilfa[vertex->N.ip.priority] += 1;
                                break;
-                       default:
+                       case SPF_TYPE_FORWARD:
+                       case SPF_TYPE_REVERSE:
                                route_table = spftree->route_table;
                                allow_ecmp = true;
 
@@ -1699,7 +1701,14 @@ static void isis_spf_loop(struct isis_spftree *spftree,
                                             VTYPE_IPREACH_TE))
                                continue;
                        break;
-               default:
+               case VTYPE_PSEUDO_IS:
+               case VTYPE_PSEUDO_TE_IS:
+               case VTYPE_NONPSEUDO_IS:
+               case VTYPE_NONPSEUDO_TE_IS:
+               case VTYPE_ES:
+               case VTYPE_IPREACH_TE:
+               case VTYPE_IP6REACH_INTERNAL:
+               case VTYPE_IP6REACH_EXTERNAL:
                        break;
                }
 
index 155d1e6fed5a1d60923b369211dc5a1d68215b6e..ed915c4561d154e79541e119252e98441fee0d1e 100644 (file)
@@ -1344,7 +1344,8 @@ void isis_te_lsp_event(struct isis_lsp *lsp, enum lsp_event event)
        case LSP_DEL:
                isis_te_delete_lsp(area->mta, lsp0);
                break;
-       default:
+       case LSP_UNKNOWN:
+       case LSP_TICK:
                break;
        }
 }
index cd085254716efcf3c46d68d6604fe9ac816169d5..7e40c21a0dbba6f1de0002fb61a41b1d8267c24d 100644 (file)
@@ -2340,9 +2340,11 @@ static const char *pdu_counter_index_to_name_json(enum pdu_counter_index index)
                return "l1-psnp";
        case L2_PARTIAL_SEQ_NUM_INDEX:
                return "l2-psnp";
-       default:
+       case PDU_COUNTER_SIZE:
                return "???????";
        }
+
+       assert(!"Reached end of function where we are not expecting to");
 }
 
 static void common_isis_summary_json(struct json_object *json,