From: Guus Sliepen Date: Mon, 23 Nov 2020 08:43:22 +0000 (+0100) Subject: Fix PMTU test case. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=689fd74cf976264f54d9c61f09ef5338fa5c5f23;p=meshlink Fix PMTU test case. --- diff --git a/test/netns_utils.c b/test/netns_utils.c index ec7aee4a..b5354a13 100644 --- a/test/netns_utils.c +++ b/test/netns_utils.c @@ -1,6 +1,6 @@ #define _GNU_SOURCE 1 -#ifndef NDEBUG +#ifdef NDEBUG #undef NDEBUG #endif diff --git a/test/pmtu.c b/test/pmtu.c index 7a179007..6f548ee3 100644 --- a/test/pmtu.c +++ b/test/pmtu.c @@ -1,4 +1,4 @@ -#ifndef NDEBUG +#ifdef NDEBUG #undef NDEBUG #endif @@ -169,9 +169,22 @@ int main(void) { meshlink_set_log_cb(states[i].mesh, MESHLINK_INFO, log_cb); // Link the relay node to the other nodes - if(i > 0) { - link_meshlink_pair(states[0].mesh, states[i].mesh); + if(i == 0) { + assert(meshlink_set_canonical_address(states[i].mesh, meshlink_get_self(states[i].mesh), "203.0.113.1", NULL)); + } else { + assert(meshlink_set_canonical_address(states[i].mesh, meshlink_get_self(states[i].mesh), "localhost", NULL)); + + char *data = meshlink_export(states[0].mesh); + assert(data); + assert(meshlink_import(states[i].mesh, data)); + free(data); + + data = meshlink_export(states[i].mesh); + assert(data); + assert(meshlink_import(states[0].mesh, data)); + free(data); } + } // Start the relay