pull/174/head
Jeff Becker 6 years ago
parent 7ad82863d2
commit 1db19b013e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -267,11 +267,11 @@ namespace llarp
// all BSDs have packet info
const ssize_t offset = 4;
ssize_t ret = ::read(fd, buf, sz);
llarp::LogInfo("got ", ret, " bytes on tun");
if(ret > offset && t->recvpkt)
{
buf += offset;
ret -= offset;
llarp::LogInfo("got ", ret, " bytes on tun");
t->recvpkt(t, llarp::InitBuffer(buf, ret));
}
return ret;
@ -427,7 +427,7 @@ struct llarp_kqueue_loop : public llarp_ev_loop
llarp::ev_io* ev = static_cast< llarp::ev_io* >(events[idx].udata);
if(ev)
{
if(events[idx].filter & EVFILT_READ && events[idx].data >= 0)
if(events[idx].filter & EVFILT_READ)
ev->read(readbuf,
std::min(sizeof(readbuf), size_t(events[idx].data)));
if(events[idx].filter & EVFILT_WRITE)

Loading…
Cancel
Save