From 59f851e91d7f777ccb401aa6620cfa4040569cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Tue, 1 Aug 2017 11:34:15 +0200 Subject: [PATCH 1/2] ospf6: Fix DEBUG compiling error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit struct ospf6_lsa doesn't have next nor prev, so it was raising a compiling error if DEBUG is set. Signed-off-by: ßingen --- ospf6d/ospf6_lsdb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c index 1d4b557cd5..55f3db89d9 100644 --- a/ospf6d/ospf6_lsdb.c +++ b/ospf6d/ospf6_lsdb.c @@ -92,8 +92,7 @@ _lsdb_count_assert (struct ospf6_lsdb *lsdb) lsdb, lsdb->count, num); for (debug = ospf6_lsdb_head (lsdb); debug; debug = ospf6_lsdb_next (debug)) - zlog_debug ("%p %p %s lsdb[%p]", debug->prev, debug->next, debug->name, - debug->lsdb); + zlog_debug ("%s lsdb[%p]", debug->name, debug->lsdb); zlog_debug ("DUMP END"); assert (num == lsdb->count); From c222aa61d685d483ac21245d51a0ed013897517a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Tue, 1 Aug 2017 11:38:19 +0200 Subject: [PATCH 2/2] ospf: Fix segfault if compiled with DEBUG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If OSPF_LS_REFRESH_TIME is 60, min_delay in ospf_refresher_register_lsa function (ospf_lsa.c) would be negative, so index (which is unsigned) would be out of range, causing a segfault. Signed-off-by: ßingen --- lib/libospf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libospf.h b/lib/libospf.h index a1ff9c24a2..ec6e642f89 100644 --- a/lib/libospf.h +++ b/lib/libospf.h @@ -35,7 +35,7 @@ /* Architectual Constants */ #ifdef DEBUG -#define OSPF_LS_REFRESH_TIME 60 +#define OSPF_LS_REFRESH_TIME 120 #else #define OSPF_LS_REFRESH_TIME 1800 #endif