]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib, bgpd: Remove UNDEFINED_NODE
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Apr 2017 12:33:43 +0000 (08:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Apr 2017 17:26:56 +0000 (13:26 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_vty.c
lib/command.h

index ef5571c9ae2e6d20a4354e0cac671ac7732e084a..44389b99c209898ebca4d66a2168323c8690c788 100644 (file)
@@ -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.  */
index 1a5e069ce322bb34f85deb65416adec4da7dd1dd..a8256c0312cdf1d85755656546cac78413fd2685 100644 (file)
@@ -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