mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 15:17:09 +00:00
Merge pull request #4846 from vivek-cumulus/rfc-5549-gua-fix-ra
Fix nexthop reg and RA enable for IPv4 route exchange using GUA IPv6 peering
This commit is contained in:
commit
d1c6230236
@ -96,6 +96,21 @@ static int bgp_holdtime_timer(struct thread *);
|
|||||||
/* BGP FSM functions. */
|
/* BGP FSM functions. */
|
||||||
static int bgp_start(struct peer *);
|
static int bgp_start(struct peer *);
|
||||||
|
|
||||||
|
/* Register peer with NHT */
|
||||||
|
static int bgp_peer_reg_with_nht(struct peer *peer)
|
||||||
|
{
|
||||||
|
int connected = 0;
|
||||||
|
|
||||||
|
if (peer->sort == BGP_PEER_EBGP && peer->ttl == 1
|
||||||
|
&& !CHECK_FLAG(peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)
|
||||||
|
&& !bgp_flag_check(peer->bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK))
|
||||||
|
connected = 1;
|
||||||
|
|
||||||
|
return bgp_find_or_add_nexthop(
|
||||||
|
peer->bgp, peer->bgp, family2afi(peer->su.sa.sa_family),
|
||||||
|
NULL, peer, connected);
|
||||||
|
}
|
||||||
|
|
||||||
static void peer_xfer_stats(struct peer *peer_dst, struct peer *peer_src)
|
static void peer_xfer_stats(struct peer *peer_dst, struct peer *peer_src)
|
||||||
{
|
{
|
||||||
/* Copy stats over. These are only the pre-established state stats */
|
/* Copy stats over. These are only the pre-established state stats */
|
||||||
@ -293,6 +308,11 @@ static struct peer *peer_xfer_conn(struct peer *from_peer)
|
|||||||
if (from_peer)
|
if (from_peer)
|
||||||
peer_xfer_stats(peer, from_peer);
|
peer_xfer_stats(peer, from_peer);
|
||||||
|
|
||||||
|
/* Register peer for NHT. This is to allow RAs to be enabled when
|
||||||
|
* needed, even on a passive connection.
|
||||||
|
*/
|
||||||
|
bgp_peer_reg_with_nht(peer);
|
||||||
|
|
||||||
bgp_reads_on(peer);
|
bgp_reads_on(peer);
|
||||||
bgp_writes_on(peer);
|
bgp_writes_on(peer);
|
||||||
thread_add_timer_msec(bm->master, bgp_process_packet, peer, 0,
|
thread_add_timer_msec(bm->master, bgp_process_packet, peer, 0,
|
||||||
@ -1382,7 +1402,6 @@ static int bgp_connect_fail(struct peer *peer)
|
|||||||
int bgp_start(struct peer *peer)
|
int bgp_start(struct peer *peer)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
int connected = 0;
|
|
||||||
|
|
||||||
bgp_peer_conf_if_to_su_update(peer);
|
bgp_peer_conf_if_to_su_update(peer);
|
||||||
|
|
||||||
@ -1439,17 +1458,10 @@ int bgp_start(struct peer *peer)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register to be notified on peer up */
|
/* Register peer for NHT. If next hop is already resolved, proceed
|
||||||
if (peer->sort == BGP_PEER_EBGP && peer->ttl == 1
|
* with connection setup, else wait.
|
||||||
&& !CHECK_FLAG(peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK)
|
*/
|
||||||
&& !bgp_flag_check(peer->bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK))
|
if (!bgp_peer_reg_with_nht(peer)) {
|
||||||
connected = 1;
|
|
||||||
else
|
|
||||||
connected = 0;
|
|
||||||
|
|
||||||
if (!bgp_find_or_add_nexthop(peer->bgp, peer->bgp,
|
|
||||||
family2afi(peer->su.sa.sa_family), NULL,
|
|
||||||
peer, connected)) {
|
|
||||||
if (bgp_zebra_num_connects()) {
|
if (bgp_zebra_num_connects()) {
|
||||||
if (bgp_debug_neighbor_events(peer))
|
if (bgp_debug_neighbor_events(peer))
|
||||||
zlog_debug("%s [FSM] Waiting for NHT",
|
zlog_debug("%s [FSM] Waiting for NHT",
|
||||||
|
@ -680,17 +680,23 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail,
|
|||||||
continue;
|
continue;
|
||||||
for (rn = bgp_table_top(table[afi]); rn;
|
for (rn = bgp_table_top(table[afi]); rn;
|
||||||
rn = bgp_route_next(rn)) {
|
rn = bgp_route_next(rn)) {
|
||||||
|
struct peer *peer;
|
||||||
|
|
||||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||||
if (!bnc)
|
if (!bnc)
|
||||||
continue;
|
continue;
|
||||||
|
peer = (struct peer *)bnc->nht_info;
|
||||||
|
|
||||||
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) {
|
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID)) {
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" %s valid [IGP metric %d], #paths %d\n",
|
" %s valid [IGP metric %d], #paths %d",
|
||||||
inet_ntop(rn->p.family,
|
inet_ntop(rn->p.family,
|
||||||
&rn->p.u.prefix, buf,
|
&rn->p.u.prefix, buf,
|
||||||
sizeof(buf)),
|
sizeof(buf)),
|
||||||
bnc->metric, bnc->path_count);
|
bnc->metric, bnc->path_count);
|
||||||
|
if (peer)
|
||||||
|
vty_out(vty, ", peer %s", peer->host);
|
||||||
|
vty_out(vty, "\n");
|
||||||
|
|
||||||
if (!detail)
|
if (!detail)
|
||||||
continue;
|
continue;
|
||||||
@ -698,10 +704,13 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail,
|
|||||||
bgp_show_nexthops_detail(vty, bgp, bnc);
|
bgp_show_nexthops_detail(vty, bgp, bnc);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
vty_out(vty, " %s invalid\n",
|
vty_out(vty, " %s invalid",
|
||||||
inet_ntop(rn->p.family,
|
inet_ntop(rn->p.family,
|
||||||
&rn->p.u.prefix, buf,
|
&rn->p.u.prefix, buf,
|
||||||
sizeof(buf)));
|
sizeof(buf)));
|
||||||
|
if (peer)
|
||||||
|
vty_out(vty, ", peer %s", peer->host);
|
||||||
|
vty_out(vty, "\n");
|
||||||
if (CHECK_FLAG(bnc->flags,
|
if (CHECK_FLAG(bnc->flags,
|
||||||
BGP_NEXTHOP_CONNECTED))
|
BGP_NEXTHOP_CONNECTED))
|
||||||
vty_out(vty, " Must be Connected\n");
|
vty_out(vty, " Must be Connected\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user