]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: updates to the ldp-sync ospf commands
authorlynne <lynne@voltanet.io>
Fri, 18 Sep 2020 18:32:24 +0000 (14:32 -0400)
committerlynne <lynne@voltanet.io>
Mon, 21 Sep 2020 16:07:13 +0000 (12:07 -0400)
Improve the output of the show ip ospf mpls ldp-sync command.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
ospfd/ospf_ldp_sync.c

index a8c9df1c5652efbb5fccebd33f518ac36857decc..2c3b6705a3283a56000f8ae8fcbb63debc0f9f9b 100644 (file)
@@ -710,8 +710,12 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty,
                        struct route_node *rn;
                        struct ospf_interface *oi;
 
-                       if (ospf_oi_count(ifp) == 0)
+                       if (ospf_oi_count(ifp) == 0 && !use_json) {
+                               if (!if_is_up(ifp))
+                                       vty_out(vty, "%s\n  Interface down\n",
+                                               ifp->name);
                                continue;
+                       }
                        for (rn = route_top(IF_OIFS(ifp)); rn;
                             rn = route_next(rn)) {
                                oi = rn->info;
@@ -739,9 +743,12 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty,
                        struct ospf_interface *oi;
 
                        if (ospf_oi_count(ifp) == 0 && !use_json) {
-                               vty_out(vty,
-                                       "  OSPF not enabled on this interface %s\n",
-                                       ifp->name);
+                               if (if_is_up(ifp))
+                                       vty_out(vty, "%s\n  OSPF not enabled\n",
+                                               ifp->name);
+                               else
+                                       vty_out(vty, "%s\n  Interface down\n",
+                                               ifp->name);
                                return CMD_SUCCESS;
                        }
                        for (rn = route_top(IF_OIFS(ifp)); rn;