From: Donald Sharp Date: Fri, 12 Jun 2015 14:59:08 +0000 (-0700) Subject: With the dynamic update groups feature, BGP updates are formed for an update X-Git-Tag: frr-2.0-rc1~1339 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=325671b7755b7db61a586dbe7732d9a8e7644b46;p=matthieu%2Ffrr.git 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. --- diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 4f42005c1b..41ee5d248b 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -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; } diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index b2c78f2c97..9aa7a4301f 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -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)); + } } }