From 39050c7e0dea9070bb91af582a6f89cfdf2063ba Mon Sep 17 00:00:00 2001 From: paco Date: Tue, 26 Jun 2018 20:16:13 +0200 Subject: [PATCH] lib ospfd: dead code (Coverity 1302503 1302502) Signed-off-by: F. Aragon --- lib/linklist.h | 1 + ospfd/ospf_ase.c | 2 +- ospfd/ospf_route.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/linklist.h b/lib/linklist.h index 39e70293d2..ea5a3531ab 100644 --- a/lib/linklist.h +++ b/lib/linklist.h @@ -52,6 +52,7 @@ struct list { }; #define listnextnode(X) ((X) ? ((X)->next) : NULL) +#define listnextnode_unchecked(X) ((X)->next) #define listhead(X) ((X) ? ((X)->head) : NULL) #define listtail(X) ((X) ? ((X)->tail) : NULL) #define listcount(X) ((X)->count) diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c index d425624862..c799a4b30f 100644 --- a/ospfd/ospf_ase.c +++ b/ospfd/ospf_ase.c @@ -582,7 +582,7 @@ static int ospf_ase_route_match_same(struct route_table *rt, /* Check each path. */ for (n1 = listhead(or->paths), n2 = listhead(newor->paths); n1 && n2; - n1 = listnextnode(n1), n2 = listnextnode(n2)) { + n1 = listnextnode_unchecked(n1), n2 = listnextnode_unchecked(n2)) { op = listgetdata(n1); newop = listgetdata(n2); diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c index b964bbab74..b36f2f4652 100644 --- a/ospfd/ospf_route.c +++ b/ospfd/ospf_route.c @@ -170,8 +170,8 @@ int ospf_route_match_same(struct route_table *rt, struct prefix_ipv4 *prefix, /* Check each path. */ for (n1 = listhead(or->paths), n2 = listhead(newor->paths); - n1 && n2; - n1 = listnextnode(n1), n2 = listnextnode(n2)) { + n1 && n2; n1 = listnextnode_unchecked(n1), + n2 = listnextnode_unchecked(n2)) { op = listgetdata(n1); newop = listgetdata(n2); -- 2.39.5