mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 16:19:20 +02:00
Use read instead of recv, #58.
This commit is contained in:
parent
4bbf4ecd14
commit
8b95bded10
|
@ -360,7 +360,8 @@ read_tun(int tun_fd, char *buf, size_t len)
|
||||||
#if defined (FREEBSD) || defined (DARWIN) || defined(NETBSD) || defined(WINDOWS32)
|
#if defined (FREEBSD) || defined (DARWIN) || defined(NETBSD) || defined(WINDOWS32)
|
||||||
/* FreeBSD/Darwin/NetBSD has no header */
|
/* FreeBSD/Darwin/NetBSD has no header */
|
||||||
int bytes;
|
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) {
|
if (bytes < 0) {
|
||||||
return bytes;
|
return bytes;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue