ToastFreeware
/
debian
/
iodine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New upstream release.
[debian/iodine.git]
/
src
/
tun.c
diff --git
a/src/tun.c
b/src/tun.c
index 57b369d915a10ad3394233f8a1866b576e96f31b..4f40dd42d35ffc893ec83c23c5d3868de3e17d23 100644
(file)
--- 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;
#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 {
if (bytes < 0) {
return bytes;
} else {