]> git.meshlink.io Git - meshlink/commitdiff
Fix PMTU test case.
authorGuus Sliepen <guus@meshlink.io>
Mon, 23 Nov 2020 08:43:22 +0000 (09:43 +0100)
committerGuus Sliepen <guus@meshlink.io>
Fri, 8 Oct 2021 18:57:24 +0000 (20:57 +0200)
test/netns_utils.c
test/pmtu.c

index ec7aee4a8e65bda041788cd890bfd8e3e3d7f18f..b5354a13e322419a95fe698b9a71764d3cb15d25 100644 (file)
@@ -1,6 +1,6 @@
 #define _GNU_SOURCE 1
 
-#ifndef NDEBUG
+#ifdef NDEBUG
 #undef NDEBUG
 #endif
 
index 7a1790075ad15d0d22e732ce3de4eb8e49436be1..6f548ee3e4dc1da54473c35229b9600b908d7822 100644 (file)
@@ -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