X-Git-Url: https://git.toastfreeware.priv.at/debian/iodine.git/blobdiff_plain/cf812f1d2258d434d6c75362a1f9e66170f0aabf..0765c39dc043fbe6480d05f402af22a46083885c:/src/tun.c?ds=sidebyside diff --git a/src/tun.c b/src/tun.c index 57b369d..4f40dd4 100644 --- a/src/tun.c +++ b/src/tun.c @@ -360,7 +360,8 @@ read_tun(int tun_fd, char *buf, size_t len) #if defined (FREEBSD) || defined (DARWIN) || defined(NETBSD) || defined(WINDOWS32) /* FreeBSD/Darwin/NetBSD has no header */ int bytes; - bytes = recv(tun_fd, buf + 4, len, 0); + memset(buf, 0, 4); + bytes = read(tun_fd, buf + 4, len - 4); if (bytes < 0) { return bytes; } else {