From 4f42188c1fe43986599a1bb9dce2998d81237f90 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 10 Oct 2020 13:03:05 -0500 Subject: [PATCH] Test for UDP MTU issues --- src/ConnectionTester.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ConnectionTester.c b/src/ConnectionTester.c index 2b9def8..6d1364e 100644 --- a/src/ConnectionTester.c +++ b/src/ConnectionTester.c @@ -12,6 +12,8 @@ #define PORT_FLAGS_MAX_COUNT 32 +#define MTU_TEST_SIZE 1040 + unsigned int LiGetPortFlagsFromStage(int stage) { switch (stage) @@ -136,7 +138,7 @@ unsigned int LiTestClientConnectivity(const char* testServer, unsigned short ref } } else { - const char buf[] = {'C', 'T', 'E', 'S', 'T'}; + const char buf[MTU_TEST_SIZE] = "moonlight-ctest"; int j; // Send a few packets since UDP is unreliable @@ -217,7 +219,7 @@ unsigned int LiTestClientConnectivity(const char* testServer, unsigned short ref LC_ASSERT(portIndex != PORT_FLAGS_MAX_COUNT); if (LiGetProtocolFromPortFlagIndex(portIndex) == IPPROTO_UDP) { - char buf[32]; + char buf[MTU_TEST_SIZE]; // A UDP socket was signalled. This could be because we got // a packet from the test server, or it could be because we