Skip to content

Commit e520035

Browse files
committed
bgpd: When deleting a neighbor from a peer-group the PGNAME is optional
Currently when deleting a neighbor from a peer-group: no neighbor A.B.C.D peer-group FOO We must specify FOO, while A.B.C.D is sufficient enough of an identifier to know what to do. Make PGNAME optional on this command and just delete the peer. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
1 parent aa86a6a commit e520035

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

bgpd/bgp_vty.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4429,7 +4429,7 @@ ALIAS_HIDDEN(neighbor_set_peer_group, neighbor_set_peer_group_hidden_cmd,
44294429

44304430
DEFUN (no_neighbor_set_peer_group,
44314431
no_neighbor_set_peer_group_cmd,
4432-
"no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group PGNAME",
4432+
"no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group [PGNAME]",
44334433
NO_STR
44344434
NEIGHBOR_STR
44354435
NEIGHBOR_ADDR_STR2
@@ -4438,21 +4438,13 @@ DEFUN (no_neighbor_set_peer_group,
44384438
{
44394439
VTY_DECLVAR_CONTEXT(bgp, bgp);
44404440
int idx_peer = 2;
4441-
int idx_word = 4;
44424441
int ret;
44434442
struct peer *peer;
4444-
struct peer_group *group;
44454443

44464444
peer = peer_lookup_vty(vty, argv[idx_peer]->arg);
44474445
if (!peer)
44484446
return CMD_WARNING_CONFIG_FAILED;
44494447

4450-
group = peer_group_lookup(bgp, argv[idx_word]->arg);
4451-
if (!group) {
4452-
vty_out(vty, "%% Configure the peer-group first\n");
4453-
return CMD_WARNING_CONFIG_FAILED;
4454-
}
4455-
44564448
if (CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE))
44574449
bgp_zebra_terminate_radv(peer->bgp, peer);
44584450

@@ -4463,7 +4455,7 @@ DEFUN (no_neighbor_set_peer_group,
44634455
}
44644456

44654457
ALIAS_HIDDEN(no_neighbor_set_peer_group, no_neighbor_set_peer_group_hidden_cmd,
4466-
"no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group PGNAME",
4458+
"no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group [PGNAME]",
44674459
NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2
44684460
"Member of the peer-group\n"
44694461
"Peer-group name\n")

0 commit comments

Comments
 (0)