+2006-05-11 Paul Jakma <paul.jakma@sun.com>
+
+ * ospf_vty.c: (general) Audit ospf_lookup calls in commands,
+ ensure check for NULL result, make vty messages consistent.
+ (show_ip_ospf_interface) Missing NULL check on ospf_lookup
+ result, fixes Coverity CID #70.
+
2006-04-24 Paul Jakma <paul.jakma@sun.com>
* (general) More Virtual-link fixes, again with much help in
struct listnode *node;
ospf = ospf_lookup ();
+ if (ospf == NULL)
+ {
+ vty_out (vty, "OSPF Routing Process not enabled%s", VTY_NEWLINE);
+ return CMD_SUCCESS;
+ }
/* Show All Interfaces. */
if (argc == 0)
ospf = ospf_lookup ();
if (ospf == NULL)
- return CMD_SUCCESS;
+ {
+ vty_out (vty, " OSPF Routing Process not enabled%s", VTY_NEWLINE);
+ return CMD_SUCCESS;
+ }
vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE,
inet_ntoa (ospf->router_id), VTY_NEWLINE, VTY_NEWLINE);
ospf = ospf_lookup ();
if (ospf == NULL)
- return CMD_SUCCESS;
+ {
+ vty_out (vty, " OSPF Routing Process not enabled%s", VTY_NEWLINE);
+ return CMD_SUCCESS;
+ }
vty_out (vty, "%s OSPF Router with ID (%s)%s%s", VTY_NEWLINE,
inet_ntoa (ospf->router_id), VTY_NEWLINE, VTY_NEWLINE);
struct ospf_if_params *params;
struct ospf_interface *oi;
struct route_node *rn;
- struct ospf *ospf;
- ospf = ospf_lookup ();
-
params = IF_DEF_PARAMS (ifp);
if (nbr_str)
/* Update timer values in neighbor structure. */
if (nbr_str)
{
- if (ospf)
+ struct ospf *ospf;
+ if ((ospf = ospf_lookup()))
{
oi = ospf_if_lookup_by_local_addr (ospf, ifp, addr);
if (oi)
struct ospf_if_params *params;
struct ospf_interface *oi;
struct route_node *rn;
- struct ospf *ospf;
-
- ospf = ospf_lookup ();
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
/* Update timer values in neighbor structure. */
if (argc == 1)
{
- if (ospf)
+ struct ospf *ospf;
+
+ if ((ospf = ospf_lookup()))
{
oi = ospf_if_lookup_by_local_addr (ospf, ifp, addr);
if (oi)
{
struct ospf *ospf;
- ospf = ospf_lookup ();
- if (ospf == NULL)
+ if ((ospf = ospf_lookup ()) == NULL)
{
- vty_out (vty, "OSPF is not enabled%s", VTY_NEWLINE);
+ vty_out (vty, " OSPF Routing Process not enabled%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
{
struct ospf *ospf;
- ospf = ospf_lookup ();
- if (ospf == NULL)
+ if ((ospf = ospf_lookup ()) == NULL)
{
- vty_out (vty, "OSPF is not enabled%s", VTY_NEWLINE);
+ vty_out (vty, " OSPF Routing Process not enabled%s", VTY_NEWLINE);
return CMD_SUCCESS;
}