]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: Fix 'show run' output of bgp
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 21 Oct 2016 13:14:41 +0000 (09:14 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 21 Oct 2016 14:39:14 +0000 (10:39 -0400)
The code in vtysh was incorrectly handling
sub-modes for a bgp config when doing a 'show run'

This commit:
commit 65efcfce427e2abb548874ebb1a11a3b2ee7bc17
Author: Lou Berger <lberger@labn.net>
Date:   Sat May 7 14:18:56 2016 -0400

    bgpd: add L3/L2VPN Virtual Network Control feature

Added vnc support to the bgp daemon.  In addition
it modified vtysh_config.c to help vtysh understand
bgp sub-modes.  This caused the output of the show
run bgp command to be displayed incorrectly:

router bgp 65001
 !
 address-family ipv4 unicast
  maximum-paths 4
 exit-address-family
 !
!
 address-family ipv6 unicast
  maximum-paths 3
 exit-address-family
!

Backing out this change allows vtysh to have the
correct display of bgp now.

Ticket: CM-13136
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: David Lamparter <equinox@opensourcerouting.org>
vtysh/vtysh_config.c

index 67fc0d77bf8b147ecebf9681b67c7bd536765041..7ad457ee7b047cbb638f9254e3f990f6d6d4ce78 100644 (file)
@@ -171,37 +171,10 @@ vtysh_config_parse_line (const char *line)
       /* Store line to current configuration. */
       if (config)
        {
-          if (strncmp (line, " address-family vpnv4",
-             strlen (" address-family vpnv4")) == 0)
-           config = config_get (BGP_VPNV4_NODE, line);
-         else if (strncmp (line, " address-family vpn6",
-             strlen (" address-family vpn6")) == 0)
-           config = config_get (BGP_VPNV6_NODE, line);
-         else if (strncmp (line, " address-family encapv6",
-             strlen (" address-family encapv6")) == 0)
-           config = config_get (BGP_ENCAPV6_NODE, line);
-         else if (strncmp (line, " address-family encap",
-             strlen (" address-family encap")) == 0)
-           config = config_get (BGP_ENCAP_NODE, line);
-         else if (strncmp (line, " address-family ipv4 multicast",
-                  strlen (" address-family ipv4 multicast")) == 0)
-           config = config_get (BGP_IPV4M_NODE, line);
-         else if (strncmp (line, " address-family ipv6",
-                  strlen (" address-family ipv6")) == 0)
-           config = config_get (BGP_IPV6_NODE, line);
-         else if (strncmp (line, " vnc defaults",
-                  strlen (" vnc defaults")) == 0)
-           config = config_get (BGP_VNC_DEFAULTS_NODE, line);
-         else if (strncmp (line, " vnc nve-group",
-                  strlen (" vnc nve-group")) == 0)
-           config = config_get (BGP_VNC_NVE_GROUP_NODE, line);
-         else if (strncmp (line, " vnc l2-group",
-                  strlen (" vnc l2-group")) == 0)
-           config = config_get (BGP_VNC_L2_GROUP_NODE, line);
-         else if (config->index == RMAP_NODE ||
-                  config->index == INTERFACE_NODE ||
-                  config->index == NS_NODE ||
-                  config->index == VTY_NODE)
+         if (config->index == RMAP_NODE ||
+             config->index == INTERFACE_NODE ||
+             config->index == NS_NODE ||
+             config->index == VTY_NODE)
            config_add_line_uniq (config->line, line);
          else
            config_add_line (config->line, line);