]> git.puffer.fish Git - matthieu/frr.git/commitdiff
With the dynamic update groups feature, BGP updates are formed for an update
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 12 Jun 2015 14:59:08 +0000 (07:59 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 12 Jun 2015 14:59:08 +0000 (07:59 -0700)
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.

bgpd/bgp_packet.c
bgpd/bgp_updgrp_packet.c

index 4f42005c1b513d954bf43e542d9163a300184a72..41ee5d248b23a8ef37b441ab3d044d3426b77101 100644 (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;
       }
 
index b2c78f2c97507bdcce544d9ec5a2937afa4ed1ae..9aa7a4301fc80ec9732539acf94c7639beb0c595 100644 (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));
+            }
        }
     }