X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps_test.c;h=ea81a28dc0d0d5e46e3992e852e687908790dcfb;hb=2bc475274bd467532a1de0cf708072292d215474;hp=0452b25cc918ae223836e1803896bf2eaeb1b7ac;hpb=1af8ca58b86f5956d6acd9f63083a84666647ef0;p=tinc diff --git a/src/sptps_test.c b/src/sptps_test.c index 0452b25c..ea81a28d 100644 --- a/src/sptps_test.c +++ b/src/sptps_test.c @@ -370,6 +370,7 @@ int main(int argc, char *argv[]) { } char buf[65535] = ""; + size_t readsize = datagram ? 1460u : sizeof(buf); fd_set fds; FD_ZERO(&fds); @@ -387,7 +388,7 @@ int main(int argc, char *argv[]) { } if(FD_ISSET(in, &fds)) { - ssize_t len = read(in, buf, sizeof(buf)); + ssize_t len = read(in, buf, readsize); if(len < 0) { fprintf(stderr, "Could not read from stdin: %s\n", strerror(errno));