From 54a1cf499432d0d618bbe59980b431dc689d2ccd Mon Sep 17 00:00:00 2001 From: razvanm Date: Fri, 13 Feb 2009 01:02:26 +0000 Subject: [PATCH] Make the serial stack refuse (with ESIZE) to send packets that are too big. --- tos/lib/serial/SerialActiveMessageP.nc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tos/lib/serial/SerialActiveMessageP.nc b/tos/lib/serial/SerialActiveMessageP.nc index 0432ad2e..7bdc5638 100644 --- a/tos/lib/serial/SerialActiveMessageP.nc +++ b/tos/lib/serial/SerialActiveMessageP.nc @@ -58,6 +58,11 @@ implementation { message_t* msg, uint8_t len) { serial_header_t* header = getHeader(msg); + + if (len > call Packet.maxPayloadLength()) { + return ESIZE; + } + header->dest = dest; // Do not set the source address or group, as doing so // prevents transparent bridging. Need a better long-term -- 2.39.2