]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd-5549-display-ll-ifname.patch
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 12 Jun 2015 14:59:12 +0000 (07:59 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 12 Jun 2015 14:59:12 +0000 (07:59 -0700)
BGP: Display Link local addr and ifname as part of 5549 support

As part of BGP unnumbered and RFC 5549 support, the implementation will honor the
link local address as the NH if present and so it'd be useful to display that
info along with the interface name, when displaying the BGP route summary. That
is what this patch aims to do.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
bgpd/bgp_route.c

index bc203d4400b8cd5c0a64aef98db6d750a5a59226..bd3388871689ee77eb645589d71ed44c7a22dc4f 100644 (file)
@@ -6676,14 +6676,46 @@ route_vty_out (struct vty *vty, struct prefix *p,
             }
           else
             {
-             len = vty_out (vty, "%s",
-                            inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
-                            buf, BUFSIZ));
-             len = 16 - len;
-             if (len < 1)
-               vty_out (vty, "%s%*s", VTY_NEWLINE, 36, " ");
-             else
-               vty_out (vty, "%*s", len, " ");
+             if ((attr->extra->mp_nexthop_len == 32) || (binfo->peer->conf_if))
+               {
+                 if (binfo->peer->conf_if)
+                   {
+                     len = vty_out (vty, "%s",
+                                    binfo->peer->conf_if);
+                     len = 7 - len; /* len of IPv6 addr + max len of def ifname */
+
+                     if (len < 1)
+                       vty_out (vty, "%s%*s", VTY_NEWLINE, 45, " ");
+                     else
+                       vty_out (vty, "%*s", len, " ");
+                   }
+                 else
+                   {
+                     len = vty_out (vty, "%s",
+                                    inet_ntop (AF_INET6,
+                                               &attr->extra->mp_nexthop_local,
+                                               buf, BUFSIZ));
+                     len = 16 - len;
+
+                     if (len < 1)
+                       vty_out (vty, "%s%*s", VTY_NEWLINE, 36, " ");
+                     else
+                       vty_out (vty, "%*s", len, " ");
+                   }
+               }
+             else
+               {
+                 len = vty_out (vty, "%s",
+                                inet_ntop (AF_INET6,
+                                           &attr->extra->mp_nexthop_global,
+                                           buf, BUFSIZ));
+                 len = 16 - len;
+
+                 if (len < 1)
+                   vty_out (vty, "%s%*s", VTY_NEWLINE, 36, " ");
+                 else
+                   vty_out (vty, "%*s", len, " ");
+               }
             }
        }
 #endif /* HAVE_IPV6 */