From 70461d793444002cc2ce99e4e62df3c367d9dd50 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 12 May 2006 22:57:57 +0000 Subject: [ospfd] CID #29, fix missing NULL check by removing unused code. 2006-05-12 Paul Jakma * ospf_lsa.c: (ospf_lsa_action) Get rid of the ospf_lookup call, which is not checked for NULL return, by stripping out functionality which is never used, hence fixing Coverity CID #29. (struct lsa_action) remove unused member. --- ospfd/ChangeLog | 8 ++++++++ ospfd/ospf_lsa.c | 24 ++---------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index dabef49e..a11c7c97 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,11 @@ +2006-05-12 Paul Jakma + + * ospf_lsa.c: (ospf_lsa_action) Get rid of the ospf_lookup + call, which is not checked for NULL return, by stripping out + functionality which is never used, hence fixing Coverity CID + #29. + (struct lsa_action) remove unused member. + 2006-05-11 Paul Jakma * ospf_vty.c: (general) Audit ospf_lookup calls in commands, diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 9a887459..9ef5a6ae 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -3615,18 +3615,13 @@ ospf_lsa_unique_id (struct ospf *ospf, } -#define LSA_ACTION_ORIGN_RTR 1 -#define LSA_ACTION_ORIGN_NET 2 -#define LSA_ACTION_FLOOD_AREA 3 -#define LSA_ACTION_FLOOD_AS 4 -#define LSA_ACTION_FLUSH_AREA 5 -#define LSA_ACTION_FLUSH_AS 6 +#define LSA_ACTION_FLOOD_AREA 1 +#define LSA_ACTION_FLUSH_AREA 2 struct lsa_action { u_char action; struct ospf_area *area; - struct ospf_interface *oi; struct ospf_lsa *lsa; }; @@ -3634,9 +3629,6 @@ static int ospf_lsa_action (struct thread *t) { struct lsa_action *data; - struct ospf *ospf; - - ospf = ospf_lookup (); data = THREAD_ARG (t); @@ -3646,24 +3638,12 @@ ospf_lsa_action (struct thread *t) switch (data->action) { - case LSA_ACTION_ORIGN_RTR: - ospf_router_lsa_refresh (data->area->router_lsa_self); - break; - case LSA_ACTION_ORIGN_NET: - ospf_network_lsa_originate (data->oi); - break; case LSA_ACTION_FLOOD_AREA: ospf_flood_through_area (data->area, NULL, data->lsa); break; - case LSA_ACTION_FLOOD_AS: - ospf_flood_through_as (ospf, NULL, data->lsa); - break; case LSA_ACTION_FLUSH_AREA: ospf_lsa_flush_area (data->lsa, data->area); break; - case LSA_ACTION_FLUSH_AS: - ospf_lsa_flush_as (ospf, data->lsa); - break; } ospf_lsa_unlock (data->lsa); -- cgit v1.2.1