mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
Fix neighbor coming up without an as specified
Ticket: CM-7012 Reviwed by: CCR-3451 Testing: See bug When you specify a neighbor <interface> <something> and don't specify a remote-as the neighbor relationship will still come up with ipv6 unnumbered if you have RA configured on the interface.
This commit is contained in:
parent
382440244a
commit
f8cfafdad4
@ -1011,7 +1011,17 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check neighbor as number. */
|
/* Check neighbor as number. */
|
||||||
if (peer->as_type == AS_INTERNAL)
|
if (peer->as_type == AS_UNSPECIFIED)
|
||||||
|
{
|
||||||
|
if (bgp_debug_neighbor_events(peer))
|
||||||
|
zlog_debug("%s bad OPEN, remote AS is unspecified currently", peer->host);
|
||||||
|
bgp_notify_send_with_data(peer,
|
||||||
|
BGP_NOTIFY_OPEN_ERR,
|
||||||
|
BGP_NOTIFY_OPEN_BAD_PEER_AS,
|
||||||
|
notify_data_remote_as, 2);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else if (peer->as_type == AS_INTERNAL)
|
||||||
{
|
{
|
||||||
if (remote_as != peer->bgp->as)
|
if (remote_as != peer->bgp->as)
|
||||||
{
|
{
|
||||||
|
@ -9498,7 +9498,12 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vty_out (vty, "remote AS %u, ", p->as);
|
if ((p->as_type == AS_SPECIFIED) ||
|
||||||
|
(p->as_type == AS_EXTERNAL) ||
|
||||||
|
(p->as_type == AS_INTERNAL))
|
||||||
|
vty_out (vty, "remote AS %u, ", p->as);
|
||||||
|
else
|
||||||
|
vty_out (vty, "remote AS Unspecified, ");
|
||||||
vty_out (vty, "local AS %u%s%s, ",
|
vty_out (vty, "local AS %u%s%s, ",
|
||||||
p->change_local_as ? p->change_local_as : p->local_as,
|
p->change_local_as ? p->change_local_as : p->local_as,
|
||||||
CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
|
CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
|
||||||
|
@ -1371,9 +1371,9 @@ peer_conf_interface_get(struct bgp *bgp, const char *conf_if, afi_t afi,
|
|||||||
{
|
{
|
||||||
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)
|
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)
|
||||||
&& afi == AFI_IP && safi == SAFI_UNICAST)
|
&& afi == AFI_IP && safi == SAFI_UNICAST)
|
||||||
peer = peer_create (NULL, conf_if, bgp, bgp->as, AS_SPECIFIED, 0, 0, 0);
|
peer = peer_create (NULL, conf_if, bgp, bgp->as, 0, AS_UNSPECIFIED, 0, 0);
|
||||||
else
|
else
|
||||||
peer = peer_create (NULL, conf_if, bgp, bgp->as, AS_SPECIFIED, 0, afi, safi);
|
peer = peer_create (NULL, conf_if, bgp, bgp->as, 0, AS_UNSPECIFIED, afi, safi);
|
||||||
|
|
||||||
if (peer && v6only)
|
if (peer && v6only)
|
||||||
SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY);
|
SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY);
|
||||||
|
Loading…
Reference in New Issue
Block a user