Skip to content

Commit 45763c7

Browse files
authored
Merge pull request #18911 from anlancs/fix/bgp-safi
bgpd: correct no form commands
2 parents eef0292 + 8172ee8 commit 45763c7

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

bgpd/bgp_vty.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9354,12 +9354,15 @@ DEFUN (no_neighbor_addpath_tx_all_paths,
93549354
{
93559355
int idx_peer = 2;
93569356
struct peer *peer;
9357+
safi_t safi = bgp_node_safi(vty);
93579358

93589359
peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
93599360
if (!peer)
93609361
return CMD_WARNING_CONFIG_FAILED;
93619362

9362-
if (peer->addpath_type[bgp_node_afi(vty)][bgp_node_safi(vty)] != BGP_ADDPATH_ALL) {
9363+
if (safi == SAFI_LABELED_UNICAST)
9364+
safi = SAFI_UNICAST;
9365+
if (peer->addpath_type[bgp_node_afi(vty)][safi] != BGP_ADDPATH_ALL) {
93639366
vty_out(vty,
93649367
"%% Peer not currently configured to transmit all paths.");
93659368
return CMD_WARNING_CONFIG_FAILED;
@@ -9451,13 +9454,15 @@ DEFUN (no_neighbor_addpath_tx_bestpath_per_as,
94519454
{
94529455
int idx_peer = 2;
94539456
struct peer *peer;
9457+
safi_t safi = bgp_node_safi(vty);
94549458

94559459
peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
94569460
if (!peer)
94579461
return CMD_WARNING_CONFIG_FAILED;
94589462

9459-
if (peer->addpath_type[bgp_node_afi(vty)][bgp_node_safi(vty)]
9460-
!= BGP_ADDPATH_BEST_PER_AS) {
9463+
if (safi == SAFI_LABELED_UNICAST)
9464+
safi = SAFI_UNICAST;
9465+
if (peer->addpath_type[bgp_node_afi(vty)][safi] != BGP_ADDPATH_BEST_PER_AS) {
94619466
vty_out(vty,
94629467
"%% Peer not currently configured to transmit all best path per as.");
94639468
return CMD_WARNING_CONFIG_FAILED;

0 commit comments

Comments
 (0)