X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fsptps_test.c;h=ea81a28dc0d0d5e46e3992e852e687908790dcfb;hp=0452b25cc918ae223836e1803896bf2eaeb1b7ac;hb=c33dd41c07c4c4578f546798264b7f467d6a7866;hpb=9250f2dc194a762e7484362c52b3abf76cae4ce2 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));