From: Donald Sharp Date: Sat, 15 Apr 2017 12:33:43 +0000 (-0400) Subject: lib, bgpd: Remove UNDEFINED_NODE X-Git-Tag: reindent-master-before~213^2~10 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b3b3879c3e65606370bdfaaf5781645a2381d8b9;p=matthieu%2Ffrr.git lib, bgpd: Remove UNDEFINED_NODE Remove the UNDEFINED_NODE as that it's implementation breaks our ability in BGP to figure out where we are by allowing default: in the switch statement. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index ef5571c9ae..44389b99c2 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -93,9 +93,6 @@ bgp_node_type (afi_t afi, safi_t safi) case SAFI_ENCAP: return BGP_ENCAP_NODE; break; - default: - return UNDEFINED_NODE; - break; } break; case AFI_IP6: @@ -116,15 +113,19 @@ bgp_node_type (afi_t afi, safi_t safi) case SAFI_ENCAP: return BGP_ENCAP_NODE; break; - default: - return UNDEFINED_NODE; - break; } break; - default: - return UNDEFINED_NODE; + case AFI_L2VPN: + return BGP_EVPN_NODE; + break; + case AFI_MAX: + // We should never be here but to clarify the switch statement.. + return BGP_IPV4_NODE; break; } + + // Impossible to happen + return BGP_IPV4_NODE; } /* Utility function to get address family from current node. */ diff --git a/lib/command.h b/lib/command.h index 1a5e069ce3..a8256c0312 100644 --- a/lib/command.h +++ b/lib/command.h @@ -136,7 +136,6 @@ enum node_type MPLS_NODE, /* MPLS config node */ VTY_NODE, /* Vty node. */ LINK_PARAMS_NODE, /* Link-parameters node */ - UNDEFINED_NODE }; /* Node which has some commands and prompt string and configuration