Giter Club home page Giter Club logo

Comments (4)

tinyos-issues avatar tinyos-issues commented on July 19, 2024

From [email protected] on December 16, 2010 23:51:26
Doesn't the above fix repeat the problem on msg? Shouldn't it be

  •   memcpy(newMsg, msg, sizeof(message_t));
    
  •    uint8_t payloadLength = getHeader(msg)->length;
    
  •    memcpy(getHeader(newMsg), msg, sizeof(serial_header_t)+payloadLength);
    

Phil

from tinyos-main.

tinyos-issues avatar tinyos-issues commented on July 19, 2024

From mortenthansen on December 17, 2010 01:44:33
I doubt your version will work.

The incomming packet (message_t* msg) is always from a serial forwarder which have no idea about the header alignment of TOSSIM messages and will then be aligned with msg->header. The new packet (message_t* newMsg) should have the prober alignment so on this message_t we should use getHeader(newMsg).

Does this make sense?

Morten.

from tinyos-main.

tinyos-issues avatar tinyos-issues commented on July 19, 2024

From [email protected] on December 18, 2010 01:42:30
It does. Sorry, it's been a long time since I saw this code; I forgot that the message coming in will be aligned at the beginning of the struct, not the proper header position. This actually suggests the typing of the functions is wrong, as technically it's not a message_t being passed in. But oh well.

I'll test your fix on Monday and check it in if it works for me.

from tinyos-main.

tinyos-issues avatar tinyos-issues commented on July 19, 2024

From [email protected] on December 22, 2010 00:30:50
I applied your fix.

from tinyos-main.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.