Skip to content

Commit fe52f73

Browse files
anlancsmergify[bot]
authored andcommitted
bgpd: correct no form commands
Before: ``` anlan(config-router-af)# neighbor 22::22 addpath-tx-all-paths anlan(config-router-af)# no neighbor 22::22 addpath-tx-all-paths % Peer not currently configured to transmit all paths.anlan(config-router-af)# ``` After: ``` anlan(config-router)# address-family ipv6 labeled-unicast anlan(config-router-af)# neighbor 22::22 addpath-tx-all-paths anlan(config-router-af)# no neighbor 22::22 addpath-tx-all-paths ``` `bgp_addpath_set_peer_type()` changes from `SAFI_LABELED_UNICAST` to `SAFI_UNICAST`, so we need the same change during the early check. Signed-off-by: anlan_cs <[email protected]> (cherry picked from commit 8172ee8)
1 parent 99595be commit fe52f73

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bgpd/bgp_vty.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9278,12 +9278,15 @@ DEFUN (no_neighbor_addpath_tx_all_paths,
92789278
{
92799279
int idx_peer = 2;
92809280
struct peer *peer;
9281+
safi_t safi = bgp_node_safi(vty);
92819282

92829283
peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
92839284
if (!peer)
92849285
return CMD_WARNING_CONFIG_FAILED;
92859286

9286-
if (peer->addpath_type[bgp_node_afi(vty)][bgp_node_safi(vty)] != BGP_ADDPATH_ALL) {
9287+
if (safi == SAFI_LABELED_UNICAST)
9288+
safi = SAFI_UNICAST;
9289+
if (peer->addpath_type[bgp_node_afi(vty)][safi] != BGP_ADDPATH_ALL) {
92879290
vty_out(vty,
92889291
"%% Peer not currently configured to transmit all paths.");
92899292
return CMD_WARNING_CONFIG_FAILED;
@@ -9375,13 +9378,15 @@ DEFUN (no_neighbor_addpath_tx_bestpath_per_as,
93759378
{
93769379
int idx_peer = 2;
93779380
struct peer *peer;
9381+
safi_t safi = bgp_node_safi(vty);
93789382

93799383
peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
93809384
if (!peer)
93819385
return CMD_WARNING_CONFIG_FAILED;
93829386

9383-
if (peer->addpath_type[bgp_node_afi(vty)][bgp_node_safi(vty)]
9384-
!= BGP_ADDPATH_BEST_PER_AS) {
9387+
if (safi == SAFI_LABELED_UNICAST)
9388+
safi = SAFI_UNICAST;
9389+
if (peer->addpath_type[bgp_node_afi(vty)][safi] != BGP_ADDPATH_BEST_PER_AS) {
93859390
vty_out(vty,
93869391
"%% Peer not currently configured to transmit all best path per as.");
93879392
return CMD_WARNING_CONFIG_FAILED;

0 commit comments

Comments
 (0)