Don't overrun MDP MTU

This commit is contained in:
Jeremy Lakeman 2016-05-23 14:57:03 +09:30
parent 177f695671
commit ade7428687
2 changed files with 4 additions and 2 deletions

View File

@ -120,7 +120,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define MDP_FORCE 0x0100
#define MDP_NOCRYPT 0x0200
#define MDP_NOSIGN 0x0400
#define MDP_MTU 1200
#define MDP_OVERLAY_MTU 1200
// worst case packet header overheads for port encoding and crypto envelopes (approx);
#define MDP_MTU (MDP_OVERLAY_MTU - 40)
#define MDP_TX 1
#define MDP_BIND 3

View File

@ -164,7 +164,7 @@ int _overlay_payload_enqueue(struct __sourceloc __whence, struct overlay_frame *
if (ob_overrun(p->payload))
return WHY("Packet content overrun -- not queueing");
if (ob_position(p->payload) >= MDP_MTU)
if (ob_position(p->payload) >= MDP_OVERLAY_MTU)
FATALF("Queued packet len %u is too big", ob_position(p->payload));
if (queue->length>=queue->maxLength)