use const reference and don't log invalid packets

pull/686/head
Jeff Becker 5 years ago
parent 454fb3bb72
commit 3ed8dec78b
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -928,14 +928,9 @@ namespace llarp
{
// called for every packet read from user in isolated network thread
TunEndpoint *self = static_cast< TunEndpoint * >(tun->user);
ManagedBuffer buf(b);
if(!self->m_UserToNetworkPktQueue.EmplaceIf(
[buf](net::IPPacket &pkt) -> bool { return pkt.Load(buf); }))
{
#if defined(DEBUG) || !defined(RELEASE_MOTTO)
llarp::LogInfo("invalid pkt");
#endif
}
const ManagedBuffer buf(b);
self->m_UserToNetworkPktQueue.EmplaceIf(
[&buf](net::IPPacket &pkt) -> bool { return pkt.Load(buf); });
}
TunEndpoint::~TunEndpoint()

Loading…
Cancel
Save