]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ospf6d] Fix ospf6d crash in show border routers
authorJon <jonirucoeith@gmail.com>
Thu, 12 Feb 2009 01:27:06 +0000 (17:27 -0800)
committerPaul Jakma <paul@quagga.net>
Thu, 18 Jun 2009 19:18:26 +0000 (20:18 +0100)
ospf6d will crash if this command is executed on a non-border-router.
Included test to verify that any routes are defined, preventing empty
pointer from being used.

ospf6d/ospf6d.c

index 7a766c8d54bb5cedace3c5298fec970f6e067137..bb091d4f3c39f151cd3de6bfd8cfed4da236e876 100644 (file)
@@ -1647,6 +1647,12 @@ DEFUN (show_ipv6_ospf6_border_routers,
 
       ospf6_linkstate_prefix (adv_router, 0, &prefix);
       ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
+      if (!ro)
+        {
+          vty_out (vty, "No Route found for Router ID: %s%s", argv[0], VNL);
+          return CMD_SUCCESS;
+        }
+
       ospf6_route_show_detail (vty, ro);
       return CMD_SUCCESS;
     }