]> git.meshlink.io Git - utcp/commitdiff
Allow setting the MTU in the test program.
authorGuus Sliepen <guus@sliepen.org>
Sun, 22 Sep 2019 11:00:08 +0000 (13:00 +0200)
committerGuus Sliepen <guus@sliepen.org>
Sun, 22 Sep 2019 11:00:08 +0000 (13:00 +0200)
test.c

diff --git a/test.c b/test.c
index 96ebb0c45799ff999d3a8af9b05d867b7eb2adf5..2784649bb5ef8a8767b079cb5bf2797099cb9386 100644 (file)
--- a/test.c
+++ b/test.c
@@ -31,6 +31,7 @@ double dropout;
 long total_out;
 long total_in;
 FILE *reference;
+long mtu = 1300;
 
 char *reorder_data;
 size_t reorder_len;
@@ -178,6 +179,10 @@ int main(int argc, char *argv[]) {
                read_size = atoi(getenv("READ_SIZE"));
        }
 
+       if(getenv("MTU")) {
+               mtu = atoi(getenv("MTU"));
+       }
+
        char *reference_filename = getenv("REFERENCE");
 
        if(reference_filename) {
@@ -235,7 +240,7 @@ int main(int argc, char *argv[]) {
                return 1;
        }
 
-       utcp_set_mtu(u, 1300);
+       utcp_set_mtu(u, mtu);
        utcp_set_user_timeout(u, 10);
 
        if(!server) {