From 60ac1b77c54ee43d3a1c0d42d9349e455c348c3c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 28 Oct 2013 13:22:23 -0400 Subject: Fix for GitHub issue #25 --- tap-mac/tuntap/src/tuntap.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tap-mac') diff --git a/tap-mac/tuntap/src/tuntap.cc b/tap-mac/tuntap/src/tuntap.cc index 941de94c..7fdbb795 100644 --- a/tap-mac/tuntap/src/tuntap.cc +++ b/tap-mac/tuntap/src/tuntap.cc @@ -648,7 +648,9 @@ tuntap_interface::cdev_write(uio_t uio, int ioflag) mb = first; while (uio_resid(uio) > 0) { /* copy a chunk. enforce mtu (don't know if this is correct behaviour) */ - chunk_len = min(ifnet_mtu(ifp), min(uio_resid(uio), mlen)); + // ... evidently not :) -- Adam Ierymenko + //chunk_len = min(ifnet_mtu(ifp), min(uio_resid(uio), mlen)); + chunk_len = min(uio_resid(uio),mlen); error = uiomove((caddr_t) mbuf_data(mb), chunk_len, uio); if (error) { log(LOG_ERR, "tuntap: could not copy data from userspace: %d\n", error); @@ -664,7 +666,9 @@ tuntap_interface::cdev_write(uio_t uio, int ioflag) copied += chunk_len; /* if done, break the loop */ - if (uio_resid(uio) <= 0 || copied >= ifnet_mtu(ifp)) + //if (uio_resid(uio) <= 0 || copied >= ifnet_mtu(ifp)) + // break; + if (uio_resid(uio) <= 0) break; /* allocate a new mbuf if the current is filled */ -- cgit v1.2.3