]> git.proxmox.com Git - mirror_frr.git/commitdiff
* ospf_vty.c: Check carefully if interface exists before trying to
authorhasso <hasso>
Wed, 17 Aug 2005 13:31:47 +0000 (13:31 +0000)
committerhasso <hasso>
Wed, 17 Aug 2005 13:31:47 +0000 (13:31 +0000)
  print info about it.

Fixes bugzilla #213. [backport candidate]

ospfd/ChangeLog
ospfd/ospf_vty.c

index cb1645904f35f10581c55e32d4687f9916a11c2a..b546bbd118e938af66b70b33b10af4fe707bf513 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-17 Hasso Tepper <hasso at quagga.net>
+
+       * ospf_vty.c: Check carefully if interface exists before trying to
+         print info about it.
+
 2005-08-05 Hasso Tepper <hasso at quagga.net>
 
        * ospf_zebra.c: Don't assert/stop before type == ZEBRA_ROUTE_MAX if
index 179464cc378d554334cf295dcc736a507a27261b..0f2a0fce5d9f339ec639a576236fa8425772a950 100644 (file)
@@ -6533,7 +6533,7 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt)
         if (or->type == OSPF_DESTINATION_NETWORK)
           for (ALL_LIST_ELEMENTS (or->paths, pnode, pnnode, path))
             {
-              if (path->oi != NULL)
+              if (path->oi != NULL && ospf_if_exists(path->oi))
                 {
                   if (path->nexthop.s_addr == 0)
                     vty_out (vty, "%24s   directly attached to %s%s",
@@ -6583,13 +6583,16 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs)
                   
                   for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path))
                     {
-                      if (path->nexthop.s_addr == 0)
-                        vty_out (vty, "%24s   directly attached to %s%s",
-                                 "", path->oi->ifp->name, VTY_NEWLINE);
-                      else
-                        vty_out (vty, "%24s   via %s, %s%s", "",
-                                 inet_ntoa (path->nexthop), path->oi->ifp->name,
-                                            VTY_NEWLINE);
+                     if (path->oi != NULL && ospf_if_exists(path->oi))
+                       {
+                         if (path->nexthop.s_addr == 0)
+                           vty_out (vty, "%24s   directly attached to %s%s",
+                                    "", path->oi->ifp->name, VTY_NEWLINE);
+                         else
+                           vty_out (vty, "%24s   via %s, %s%s", "",
+                                    inet_ntoa (path->nexthop),
+                                    path->oi->ifp->name, VTY_NEWLINE);
+                       }
                     }
           }
       }
@@ -6627,7 +6630,7 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt)
 
         for (ALL_LIST_ELEMENTS (er->paths, pnode, pnnode, path))
           {
-            if (path->oi != NULL)
+            if (path->oi != NULL && ospf_if_exists(path->oi))
               {
                 if (path->nexthop.s_addr == 0)
                   vty_out (vty, "%24s   directly attached to %s%s",