[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420 CC2420ActiveMessageP.nc, 1.18, 1.19

dmm rincon at users.sourceforge.net
Mon Aug 18 15:04:17 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20999

Modified Files:
	CC2420ActiveMessageP.nc 
Log Message:
Added a length check to make sure we don't try to send a packet that is too big



Index: CC2420ActiveMessageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/CC2420ActiveMessageP.nc,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** CC2420ActiveMessageP.nc	24 Jun 2008 05:32:31 -0000	1.18
--- CC2420ActiveMessageP.nc	18 Aug 2008 22:04:15 -0000	1.19
***************
*** 63,66 ****
--- 63,71 ----
  					  uint8_t len) {
      cc2420_header_t* header = call CC2420PacketBody.getHeader( msg );
+     
+     if (len > call Packet.maxPayloadLength()) {
+       return ESIZE;
+     }
+     
      header->type = id;
      header->dest = addr;



More information about the Tinyos-2-commits mailing list