With the dynamic update groups feature, BGP updates are formed for an update

group and then replicated and sent for each member peer. The nexthop field
in the update is set only as part of this final step, as it may differ per
member peer. Update logs to display the final nexthop that is sent.
This commit is contained in:
Donald Sharp 2015-06-12 07:59:08 -07:00
parent 3811f1e2a5
commit 325671b775
2 changed files with 24 additions and 4 deletions

View File

@ -262,10 +262,6 @@ bgp_write_packet (struct peer *peer)
*/
s = bpacket_reformat_for_peer (next_pkt, paf);
bpacket_queue_advance_peer (paf);
if (bgp_debug_update(peer, NULL, NULL, 0))
zlog_debug ("u%" PRIu64 ":s%" PRIu64 "%s send UPDATE len %zu ",
PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id,
peer->host, (stream_get_endp(s) - stream_get_getp(s)));
return s;
}

View File

@ -409,6 +409,8 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
struct stream *s = NULL;
bpacket_attr_vec *vec;
struct peer *peer;
char buf[BUFSIZ];
char buf2[BUFSIZ];
s = stream_dup (pkt->buffer);
peer = PAF_PEER(paf);
@ -471,6 +473,11 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
if (nh_modified)
stream_put_in_addr_at (s, vec->offset + 1, mod_v4nh);
if (bgp_debug_update(peer, NULL, NULL, 0))
zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s",
PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id,
peer->host, inet_ntoa (*mod_v4nh));
}
else if (paf->afi == AFI_IP6 || peer_cap_enhe(peer))
{
@ -531,6 +538,23 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf)
stream_put_in6_addr_at (s, vec->offset + 1, mod_v6nhg);
if (lnh_modified)
stream_put_in6_addr_at (s, vec->offset + 1 + 16, mod_v6nhl);
if (bgp_debug_update(peer, NULL, NULL, 0))
{
if (nhlen == 32)
zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthops %s, %s",
PAF_SUBGRP(paf)->update_group->id,
PAF_SUBGRP(paf)->id,
peer->host,
inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ),
inet_ntop (AF_INET6, mod_v6nhl, buf2, BUFSIZ));
else
zlog_debug ("u" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ mp_nexthop %s",
PAF_SUBGRP(paf)->update_group->id,
PAF_SUBGRP(paf)->id,
peer->host,
inet_ntop (AF_INET6, mod_v6nhg, buf, BUFSIZ));
}
}
}