[Tinyos-devel] TossimActiveMessageP.nc payload pointer correct?
Philip Levis
pal at cs.stanford.edu
Wed May 17 22:40:57 PDT 2006
Omprakash Gnawali wrote:
> While Rodrigo and I were working on one of our bugs today, we stumbled
> on to these lines in TossimActiveMessageP.nc:
>
> event void Model.receive(message_t* msg) {
> uint8_t len;
> void* payload = call Packet.getPayload(msg, &len);
>
> memcpy(bufferPointer, msg, sizeof(message_t));
>
> ....
>
> bufferPointer = signal Receive.receive[call AMPacket.type(bufferPointer)]
> (bufferPointer, payload, len);
>
> ...
> }
>
> Should "payload" on Receive.receive call be obtained from
> bufferPointer instead of msg? In the above code, payload points to
> data on the incoming message instead of data on bufferPointer.
>
Yes, it should. Rodrigo pointed it out earlier today; the fix is in CVS.
Thanks!
There is also a recent TOSSIM bug fix (2 weeks or so ago?) for
acknowledgments, where acknowledgments are never requested. It's a bug
that is only really observable in Cygwin, as in Linux the malloc'd
structure often has a 1 bit in the ack field.
Phil
More information about the Tinyos-devel
mailing list