Skip to content

Commit

Permalink
Revert "tuntap: fix reading too much (useless) data."
Browse files Browse the repository at this point in the history
This reverts commit bc34fb8.
  • Loading branch information
zehome committed Dec 30, 2016
1 parent bc34fb8 commit 14e17e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tuntap_bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mlvpn_tuntap_read(struct tuntap_s *tuntap)
iov[0].iov_base = &type;
iov[0].iov_len = sizeof(type);
iov[1].iov_base = &data;
iov[1].iov_len = tuntap->maxmtu;
iov[1].iov_len = DEFAULT_MTU;
ret = readv(tuntap->fd, iov, 2);
if (ret < 0) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
Expand Down
2 changes: 1 addition & 1 deletion src/tuntap_darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mlvpn_tuntap_read(struct tuntap_s *tuntap)
{
ssize_t ret;
u_char data[DEFAULT_MTU];
ret = read(tuntap->fd, &data, tuntap->maxmtu);
ret = read(tuntap->fd, &data, DEFAULT_MTU);
if (ret < 0) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
/* read error on tuntap is not recoverable. We must die. */
Expand Down
2 changes: 1 addition & 1 deletion src/tuntap_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mlvpn_tuntap_read(struct tuntap_s *tuntap)
{
ssize_t ret;
u_char data[DEFAULT_MTU];
ret = read(tuntap->fd, &data, tuntap->maxmtu);
ret = read(tuntap->fd, &data, DEFAULT_MTU);
if (ret < 0) {
if (errno != EAGAIN && errno != EWOULDBLOCK) {
/* read error on tuntap is not recoverable. We must die. */
Expand Down

0 comments on commit 14e17e8

Please sign in to comment.