aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/routing-table.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-06-25 01:28:18 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-06-25 16:48:39 +0200
commit3e8c04a03f4070e23fc737f30c25a79d5958d734 (patch)
tree23354ba5aec33b7068421524c3e514767a1e42fb /src/routing-table.c
parentnonce: switch to RFC6479 to better support packet reordering (diff)
downloadwireguard-monolithic-historical-3e8c04a03f4070e23fc737f30c25a79d5958d734.tar.xz
wireguard-monolithic-historical-3e8c04a03f4070e23fc737f30c25a79d5958d734.zip
tests: make fatal
Diffstat (limited to '')
-rw-r--r--src/routing-table.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/routing-table.c b/src/routing-table.c
index ec98f1d..baa924a 100644
--- a/src/routing-table.c
+++ b/src/routing-table.c
@@ -537,12 +537,12 @@ static inline struct in6_addr *ip6(uint32_t a, uint32_t b, uint32_t c, uint32_t
return &ip;
}
-void routing_table_selftest(void)
+bool routing_table_selftest(void)
{
struct routing_table t;
struct wireguard_peer *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL, *f = NULL, *g = NULL, *h = NULL;
size_t i = 0;
- bool success = true;
+ bool success = false;
struct in6_addr ip;
__be64 part;
@@ -576,6 +576,7 @@ void routing_table_selftest(void)
insert(4, h, 64, 15, 123, 211, 25); /* maskself is required */
#undef insert
+ success = true;
#define test(version, mem, ipa, ipb, ipc, ipd) do { \
bool _s = routing_table_lookup_v##version(&t, ip##version(ipa, ipb, ipc, ipd)) == mem; \
++i; \
@@ -629,5 +630,7 @@ free:
kfree(f);
kfree(g);
kfree(h);
+
+ return success;
}
#endif