aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-07 21:27:58 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-07 21:27:58 +0100
commit70b1266a40ba6c3d376c6a362b12c369d9f8eb97 (patch)
tree56dc71ec0ba798ceaa4a83138f0d1f324e0e5ffa /src
parentsend: simplify handshake initiation queueing and introduce lock (diff)
downloadwireguard-monolithic-historical-70b1266a40ba6c3d376c6a362b12c369d9f8eb97.tar.xz
wireguard-monolithic-historical-70b1266a40ba6c3d376c6a362b12c369d9f8eb97.zip
selftest: add routing table tests for small subnets
Diffstat (limited to 'src')
-rw-r--r--src/selftest/routing-table.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/selftest/routing-table.h b/src/selftest/routing-table.h
index 6db7958..fe7a0bc 100644
--- a/src/selftest/routing-table.h
+++ b/src/selftest/routing-table.h
@@ -57,6 +57,12 @@ bool routing_table_selftest(void)
insert(6, a, 0x24046800, 0x40040800, 0xdeadbeef, 0xdeadbeef, 128);
insert(4, g, 64, 15, 112, 0, 20);
insert(4, h, 64, 15, 123, 211, 25); /* maskself is required */
+ insert(4, a, 10, 0, 0, 0, 25);
+ insert(4, b, 10, 0, 0, 128, 25);
+ insert(4, a, 10, 1, 0, 0, 30);
+ insert(4, b, 10, 1, 0, 4, 30);
+ insert(4, c, 10, 1, 0, 8, 29);
+ insert(4, d, 10, 1, 0, 16, 29);
#undef insert
success = true;
@@ -90,6 +96,12 @@ bool routing_table_selftest(void)
test(4, g, 64, 15, 123, 1);
test(4, h, 64, 15, 123, 128);
test(4, h, 64, 15, 123, 129);
+ test(4, a, 10, 0, 0, 52);
+ test(4, b, 10, 0, 0, 220);
+ test(4, a, 10, 1, 0, 2);
+ test(4, b, 10, 1, 0, 6);
+ test(4, c, 10, 1, 0, 10);
+ test(4, d, 10, 1, 0, 20);
#undef test
/* These will hit the BUG_ON(len >= 128) in free_node if something goes wrong. */