]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix partial match on <external|internal> for remote-as
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 14 Nov 2016 19:15:43 +0000 (19:15 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 14 Nov 2016 19:15:43 +0000 (19:15 +0000)
Ticket: CM-8545

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_vty.c

index d8ffcc46796a39d623cc1802663e9e41ca605b65..148d8f19a04b58b2bdcfad385342e1a673035166 100644 (file)
@@ -2547,12 +2547,12 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str,
 
   bgp = vty->index;
 
-  if (strncmp(as_str, "internal", strlen("internal")) == 0)
+  if (as_str[0] == 'i')
     {
       as = 0;
       as_type = AS_INTERNAL;
     }
-  else if (strncmp(as_str, "external", strlen("external")) == 0)
+  else if (as_str[0] == 'e')
     {
       as = 0;
       as_type = AS_EXTERNAL;
@@ -2644,11 +2644,11 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi,
 
   if (as_str)
     {
-      if (strncmp(as_str, "internal", strlen("internal")) == 0)
+      if (as_str[0] == 'i')
         {
           as_type = AS_INTERNAL;
         }
-      else if (strncmp(as_str, "external", strlen("external")) == 0)
+      else if (as_str[0] == 'e')
         {
           as_type = AS_EXTERNAL;
         }