diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-11-09 08:24:51 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-11-09 08:24:51 +0100 |
commit | 4c4ff4c13693ff2beb18931577423edcdc4a0403 (patch) | |
tree | 0e65db273e6b31ce592f417ba83bb011b758c2a6 | |
parent | bgpd: actually set maxpaths (diff) | |
download | frr-4c4ff4c13693ff2beb18931577423edcdc4a0403.tar.xz frr-4c4ff4c13693ff2beb18931577423edcdc4a0403.zip |
bgpd, vtysh: Fix failing bgp cli
* bgp bestpath as-path multipath-relax
* address-family encap
* address-family encapv4
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgp_vty.c | 33 | ||||
-rwxr-xr-x | vtysh/extract.pl.in | 3 | ||||
-rw-r--r-- | vtysh/vtysh.c | 16 |
3 files changed, 21 insertions, 31 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 5cc4a4f7e..707fc0d9f 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1919,7 +1919,7 @@ DEFUN (bgp_bestpath_aspath_multipath_relax, "Generate an AS_SET\n" "Do not generate an AS_SET\n") { - int idx_as_set = 4; + int idx = 0; struct bgp *bgp; bgp = vty->index; @@ -1927,7 +1927,7 @@ DEFUN (bgp_bestpath_aspath_multipath_relax, /* no-as-set is now the default behavior so we can silently * ignore it */ - if (argv[idx_as_set]->arg != NULL && strncmp (argv[idx_as_set]->arg, "a", 1) == 0) + if (argv_find (argv, argc, "as-set", &idx)) bgp_flag_set (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET); else bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET) ; @@ -3832,21 +3832,22 @@ DEFUN (neighbor_send_community_type, "Send Extended Community attributes\n" "Send Standard Community attributes\n") { - int idx_peer = 1; - int idx_type = 3; - if (strncmp (argv[idx_type]->arg, "s", 1) == 0) - return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), - bgp_node_safi (vty), - PEER_FLAG_SEND_COMMUNITY); - if (strncmp (argv[idx_type]->arg, "e", 1) == 0) - return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), - bgp_node_safi (vty), - PEER_FLAG_SEND_EXT_COMMUNITY); + int idx = 0; + u_int32_t flag = 0; - return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), - bgp_node_safi (vty), - (PEER_FLAG_SEND_COMMUNITY| - PEER_FLAG_SEND_EXT_COMMUNITY)); + char *peer = argv[1]->arg; + + if (argv_find (argv, argc, "standard", &idx)) + SET_FLAG (flag, PEER_FLAG_SEND_COMMUNITY); + else if (argv_find (argv, argc, "extended", &idx)) + SET_FLAG (flag, PEER_FLAG_SEND_EXT_COMMUNITY); + else + { + SET_FLAG (flag, PEER_FLAG_SEND_COMMUNITY); + SET_FLAG (flag, PEER_FLAG_SEND_EXT_COMMUNITY); + } + + return peer_af_flag_set_vty (vty, peer, bgp_node_afi (vty), bgp_node_safi (vty), flag); } DEFUN (no_neighbor_send_community_type, diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in index 8850ec0e8..670982659 100755 --- a/vtysh/extract.pl.in +++ b/vtysh/extract.pl.in @@ -60,8 +60,7 @@ $ignore{'"address-family ipv6 <unicast|multicast>"'} = "ignore"; $ignore{'"address-family vpnv4"'} = "ignore"; $ignore{'"address-family vpnv4 unicast"'} = "ignore"; $ignore{'"address-family ipv4 vrf NAME"'} = "ignore"; -$ignore{'"address-family encap"'} = "ignore"; -$ignore{'"address-family encapv4"'} = "ignore"; +$ignore{'"address-family <encap|encapv4>"'} = "ignore"; $ignore{'"address-family encapv6"'} = "ignore"; $ignore{'"address-family vpnv6"'} = "ignore"; $ignore{'"address-family vpnv6 unicast"'} = "ignore"; diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index e4c3ce76f..36ec565ec 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1116,21 +1116,11 @@ DEFUNSH (VTYSH_BGPD, } DEFUNSH (VTYSH_BGPD, - address_family_encap, - address_family_encap_cmd, - "address-family encap", - "Enter Address Family command mode\n" - "Address Family\n") -{ - vty->node = BGP_ENCAP_NODE; - return CMD_SUCCESS; -} - -DEFUNSH (VTYSH_BGPD, address_family_encapv4, address_family_encapv4_cmd, - "address-family encapv4", + "address-family <encap|encapv4>", "Enter Address Family command mode\n" + "Address Family\n" "Address Family\n") { vty->node = BGP_ENCAP_NODE; @@ -3220,7 +3210,7 @@ vtysh_init_vty (void) install_element (CONFIG_NODE, &router_bgp_cmd); install_element (BGP_NODE, &address_family_vpnv4_cmd); install_element (BGP_NODE, &address_family_vpnv6_cmd); - install_element (BGP_NODE, &address_family_encap_cmd); + install_element (BGP_NODE, &address_family_encapv4_cmd); install_element (BGP_NODE, &address_family_encapv6_cmd); #if defined(ENABLE_BGP_VNC) install_element (BGP_NODE, &vnc_defaults_cmd); |