]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib ospfd: dead code (Coverity 1302503 1302502) 2559/head
authorpaco <paco@voltanet.io>
Tue, 26 Jun 2018 18:16:13 +0000 (20:16 +0200)
committerpaco <paco@voltanet.io>
Tue, 26 Jun 2018 19:39:56 +0000 (21:39 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
lib/linklist.h
ospfd/ospf_ase.c
ospfd/ospf_route.c

index 39e70293d24bafd974afaf87f5221bef01c3861a..ea5a3531ab10caddbb8a8d62a3665cd259c87468 100644 (file)
@@ -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)
index d42562486299fa4f336f28848bb48ba8e6eb43c0..c799a4b30f9840e4bbb65f6a4934075af9ce6ada 100644 (file)
@@ -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);
 
index b964bbab74092763cab8639056c71eb04459f775..b36f2f4652069ee0f95d2775af6980a96856f5ea 100644 (file)
@@ -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);