From: paco Date: Tue, 26 Jun 2018 18:16:13 +0000 (+0200) Subject: lib ospfd: dead code (Coverity 1302503 1302502) X-Git-Tag: frr-6.1-dev~239^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=39050c7e0dea9070bb91af582a6f89cfdf2063ba;p=matthieu%2Ffrr.git lib ospfd: dead code (Coverity 1302503 1302502) Signed-off-by: F. Aragon --- 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);