]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420/CC2420ActiveMessageP.nc
Upstream commits to tos/chips/cc2420, Aug 7 2008 thru Jul 16 2009, except one.
[tinyos-2.x.git] / tos / chips / cc2420 / CC2420ActiveMessageP.nc
index be40963711905e0cd6ab4cc049dbf23c8fa3ee30..0db2423c7b83167d7bf41b4797e85c117b52cb8f 100644 (file)
@@ -62,6 +62,11 @@ implementation {
                                          message_t* msg,
                                          uint8_t len) {
     cc2420_header_t* header = call CC2420PacketBody.getHeader( msg );
+    
+    if (len > call Packet.maxPayloadLength()) {
+      return ESIZE;
+    }
+    
     header->type = id;
     header->dest = addr;
     header->destpan = call CC2420Config.getPanAddr();