summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-01-10 16:17:37 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-01-10 16:17:37 +0100
commit2e507a745733b0cee2ea7d302cc9d626cb2e0c80 (patch)
tree41e0106b834a382dc4b3a329625f655819c6b3d9
parent72163bd5f3ccefc1edda585f6f605c37e774a0b8 (diff)
Use non-fatal asserts even for regular build
-rw-r--r--lib/birdlib.h4
-rw-r--r--nest/proto.c2
-rw-r--r--proto/rpki/ssh_transport.c2
-rw-r--r--proto/rpki/tcp_transport.c2
4 files changed, 3 insertions, 7 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h
index f41cceb5..428b3209 100644
--- a/lib/birdlib.h
+++ b/lib/birdlib.h
@@ -152,9 +152,9 @@ void debug(const char *msg, ...); /* Printf to debug output */
#endif
#ifdef DEBUGGING
-#define ASSERT(x) do { if (!(x)) bug("Assertion `%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
+#define ASSERT(x) do { if (!(x)) bug("Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
#else
-#define ASSERT(x) do { } while(0)
+#define ASSERT(x) do { if (!(x)) log(L_BUG "Assertion '%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
#endif
/* Pseudorandom numbers */
diff --git a/nest/proto.c b/nest/proto.c
index d584cb93..15d6f4de 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -437,7 +437,7 @@ static void
channel_request_reload(struct channel *c)
{
ASSERT(c->channel_state == CS_UP);
- // ASSERT(channel_reloadable(c));
+ ASSERT(channel_reloadable(c));
c->proto->reload_routes(c);
diff --git a/proto/rpki/ssh_transport.c b/proto/rpki/ssh_transport.c
index cd49ab90..13e061fc 100644
--- a/proto/rpki/ssh_transport.c
+++ b/proto/rpki/ssh_transport.c
@@ -42,8 +42,6 @@ rpki_tr_ssh_open(struct rpki_tr_sock *tr)
static const char *
rpki_tr_ssh_ident(struct rpki_tr_sock *tr)
{
- ASSERT(tr != NULL);
-
struct rpki_cache *cache = tr->cache;
struct rpki_config *cf = (void *) cache->p->p.cf;
struct rpki_tr_ssh_config *ssh_cf = (void *) cf->tr_config.spec;
diff --git a/proto/rpki/tcp_transport.c b/proto/rpki/tcp_transport.c
index 6c05964a..0d3c7e99 100644
--- a/proto/rpki/tcp_transport.c
+++ b/proto/rpki/tcp_transport.c
@@ -37,8 +37,6 @@ rpki_tr_tcp_open(struct rpki_tr_sock *tr)
static const char *
rpki_tr_tcp_ident(struct rpki_tr_sock *tr)
{
- ASSERT(tr != NULL);
-
struct rpki_cache *cache = tr->cache;
struct rpki_config *cf = (void *) cache->p->p.cf;