]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Show IPv6 link-local interfaces under `show interface brief` output 15055/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 21 Dec 2023 13:13:16 +0000 (15:13 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 21 Dec 2023 20:57:11 +0000 (22:57 +0200)
Despite if it's managed by FRR or the kernel, show it. If the system has only
link-local addresses, we should show it unless it's a secondary one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
zebra/interface.c

index bbb72675f1e58c7b0a432e7eb0229106f8fa9a85..6115ed0a025069d347d49400badeb12b6974fcf8 100644 (file)
@@ -2500,28 +2500,21 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf)
                                v6_list_size++;
                }
                frr_each (if_connected, ifp->connected, connected) {
-                       if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
-                           && !CHECK_FLAG(connected->flags,
-                                          ZEBRA_IFA_SECONDARY)
-                           && (connected->address->family == AF_INET6)) {
+                       if (!CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY) &&
+                           (connected->address->family == AF_INET6)) {
                                p = connected->address;
-                               /* Don't print link local pfx */
-                               if (!IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6)) {
-                                       if (first_pfx_printed) {
-                                               /* padding to prepare row only
-                                                * for ip addr */
-                                               vty_out(vty, "%-40s", "");
-                                               if (v6_list_size > 1)
-                                                       vty_out(vty, "+ ");
-                                               vty_out(vty, "%pFX\n", p);
-                                       } else {
-                                               if (v6_list_size > 1)
-                                                       vty_out(vty, "+ ");
-                                               vty_out(vty, "%pFX\n", p);
-                                       }
-                                       first_pfx_printed = true;
-                                       break;
+                               if (first_pfx_printed) {
+                                       vty_out(vty, "%-40s", "");
+                                       if (v6_list_size > 1)
+                                               vty_out(vty, "+ ");
+                                       vty_out(vty, "%pFX\n", p);
+                               } else {
+                                       if (v6_list_size > 1)
+                                               vty_out(vty, "+ ");
+                                       vty_out(vty, "%pFX\n", p);
                                }
+                               first_pfx_printed = true;
+                               break;
                        }
                }
                if (!first_pfx_printed)
@@ -2549,12 +2542,7 @@ static void ifs_dump_brief_vty_json(json_object *json, struct vrf *vrf)
                json_addrs = json_object_new_array();
                json_object_object_add(json_if, "addresses", json_addrs);
                frr_each (if_connected, ifp->connected, connected) {
-                       if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
-                           && !CHECK_FLAG(connected->flags,
-                                          ZEBRA_IFA_SECONDARY)
-                           && !(connected->address->family == AF_INET6
-                                && IN6_IS_ADDR_LINKLOCAL(
-                                        &connected->address->u.prefix6))) {
+                       if (!CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY)) {
                                char buf[PREFIX2STR_BUFFER];
 
                                json_array_string_add(