mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-04 04:40:50 +00:00
send() is supposed to always free buffers, even if it returns an error
This commit is contained in:
parent
bb9f595b8b
commit
80268ea56a
@ -44,7 +44,7 @@ void Router::loop()
|
|||||||
/**
|
/**
|
||||||
* Send a packet on a suitable interface. This routine will
|
* Send a packet on a suitable interface. This routine will
|
||||||
* later free() the packet to pool. This routine is not allowed to stall.
|
* later free() the packet to pool. This routine is not allowed to stall.
|
||||||
* If the txmit queue is full it might return an error
|
* If the txmit queue is full it might return an error.
|
||||||
*/
|
*/
|
||||||
ErrorCode Router::send(MeshPacket *p)
|
ErrorCode Router::send(MeshPacket *p)
|
||||||
{
|
{
|
||||||
@ -53,6 +53,7 @@ ErrorCode Router::send(MeshPacket *p)
|
|||||||
return iface->send(p);
|
return iface->send(p);
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Dropping packet - no interfaces - fr=0x%x,to=0x%x,id=%d\n", p->from, p->to, p->id);
|
DEBUG_MSG("Dropping packet - no interfaces - fr=0x%x,to=0x%x,id=%d\n", p->from, p->to, p->id);
|
||||||
|
packetPool.release(p);
|
||||||
return ERRNO_NO_INTERFACES;
|
return ERRNO_NO_INTERFACES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user