From: razvanm Date: Fri, 13 Feb 2009 01:02:26 +0000 (+0000) Subject: Make the serial stack refuse (with ESIZE) to send packets that are too big. X-Git-Tag: rc_6_tinyos_2_1_1~492 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=54a1cf499432d0d618bbe59980b431dc689d2ccd;hp=bda0ab8cf8ccfacebbe902bc94f6bf99c6b9e452;p=tinyos-2.x.git Make the serial stack refuse (with ESIZE) to send packets that are too big. --- 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