]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Do not use `case default` for switches that have enum
authorDonald Sharp <sharpd@nvidia.com>
Sat, 17 Apr 2021 22:01:53 +0000 (18:01 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 4 May 2021 13:03:27 +0000 (09:03 -0400)
Found a couple spots where FRR was using `case default` when
using a switch over an enum.  In this case we *must* enumerate
all states as part of the switch.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd/ospf_sr.c
ospfd/ospf_zebra.c

index a7a2e03632f813123ea62584c64b10a49b92d449..d003f3bf7cde438eaab9249db66e41391844c88e 100644 (file)
@@ -1689,7 +1689,8 @@ void ospf_sr_ext_itf_add(struct ext_itf *exti)
                else
                        srl->nhlfe[1].nexthop = exti->rmt_itf_addr.value;
                break;
-       default:
+       case PREF_SID:
+       case LOCAL_SID:
                /* Wrong SID Type. Abort! */
                XFREE(MTYPE_OSPF_SR_PARAMS, srl);
                return;
index 0d5194a3b350477b71cda3f51edc2b03bb263532..dfbb9aa2f8af2a0ab7ebb903f349a4a470f9e8b0 100644 (file)
@@ -637,7 +637,8 @@ void ospf_zebra_update_prefix_sid(const struct sr_prefix *srp)
                        }
                }
                break;
-       default:
+       case ADJ_SID:
+       case LAN_ADJ_SID:
                return;
        }