mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-14 12:52:37 +00:00
Merge pull request #11145 from donaldsharp/bgp_capability
Bgp capability
This commit is contained in:
commit
00b0b74847
@ -5273,6 +5273,12 @@ DEFUN (neighbor_capability_enhe,
|
||||
"Advertise extended next-hop capability to the peer\n")
|
||||
{
|
||||
int idx_peer = 1;
|
||||
struct peer *peer;
|
||||
|
||||
peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
|
||||
if (peer && peer->conf_if)
|
||||
return CMD_SUCCESS;
|
||||
|
||||
return peer_flag_set_vty(vty, argv[idx_peer]->arg,
|
||||
PEER_FLAG_CAPABILITY_ENHE);
|
||||
}
|
||||
@ -5287,6 +5293,16 @@ DEFUN (no_neighbor_capability_enhe,
|
||||
"Advertise extended next-hop capability to the peer\n")
|
||||
{
|
||||
int idx_peer = 2;
|
||||
struct peer *peer;
|
||||
|
||||
peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
|
||||
if (peer && peer->conf_if) {
|
||||
vty_out(vty,
|
||||
"Peer %s cannot have capability extended-nexthop turned off\n",
|
||||
argv[idx_peer]->arg);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
|
||||
PEER_FLAG_CAPABILITY_ENHE);
|
||||
}
|
||||
@ -16614,7 +16630,8 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
|
||||
|
||||
/* capability extended-nexthop */
|
||||
if (peergroup_flag_check(peer, PEER_FLAG_CAPABILITY_ENHE)) {
|
||||
if (CHECK_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE))
|
||||
if (CHECK_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE) &&
|
||||
!peer->conf_if)
|
||||
vty_out(vty,
|
||||
" no neighbor %s capability extended-nexthop\n",
|
||||
addr);
|
||||
|
@ -4487,7 +4487,9 @@ static int peer_flag_modify(struct peer *peer, uint32_t flag, int set)
|
||||
if (set) {
|
||||
bgp_zebra_initiate_radv(peer->bgp, peer);
|
||||
} else if (peer_group_active(peer)) {
|
||||
if (!CHECK_FLAG(peer->group->conf->flags, flag))
|
||||
if (!CHECK_FLAG(peer->group->conf->flags,
|
||||
flag) &&
|
||||
!peer->conf_if)
|
||||
bgp_zebra_terminate_radv(peer->bgp,
|
||||
peer);
|
||||
} else
|
||||
@ -4525,7 +4527,7 @@ static int peer_flag_modify(struct peer *peer, uint32_t flag, int set)
|
||||
/* Update flag on peer-group member. */
|
||||
COND_FLAG(member->flags, flag, set != member_invert);
|
||||
|
||||
if (flag == PEER_FLAG_CAPABILITY_ENHE)
|
||||
if (flag == PEER_FLAG_CAPABILITY_ENHE && !member->conf_if)
|
||||
set ? bgp_zebra_initiate_radv(member->bgp, member)
|
||||
: bgp_zebra_terminate_radv(member->bgp, member);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user