135u5 / tinyos-main

Automatically exported from code.google.com/p/tinyos-main
1 stars 0 forks source link

DRIP's DisseminationEngineImplP does not check busy flag when receiving old version neighbor #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
See tos/lib/net/drip/DisseminationEngineImplP line 224 where sendObject is 
called without checking for m_running and m_bufBusy flags as done for all other 
calls to sendObject.

Line 224:
sendObject( key );

Should be changed to:

if ( !m_running || m_bufBusy ) { return msg; }
sendObject( key );

Alternatively, the trickle timer could be reset instead of sending object 
immediately.

This is a copy of an old post on tinyos-devel which never got any response:
https://www.millennium.berkeley.edu/pipermail/tinyos-devel/2010-June/004468.html

Original issue reported on code.google.com by mortenthansen on 6 Jan 2011 at 6:31

GoogleCodeExporter commented 8 years ago

Original comment by philip.l...@gmail.com on 10 Jan 2011 at 2:13

GoogleCodeExporter commented 8 years ago
I see line 224 as 

  event message_t* ProbeReceive.receive( message_t* msg, 
                     void* payload, 
                     uint8_t len) {

    dissemination_probe_message_t* dpMsg = 
224->      (dissemination_probe_message_t*) payload;

    if ( !m_running ) { return msg; }

    if ( call DisseminationCache.requestSeqno[ dpMsg->key ]() != 
     DISSEMINATION_SEQNO_UNKNOWN ) {    
      sendObject( dpMsg->key );
    }

    return msg;
  }

Which version of the file are you looking at?

It looks a cleaner fix is to put the m_buf and running check in sendObject, 
then remove the individual tests from call points. Would you agree?

Original comment by philip.l...@gmail.com on 13 Jan 2011 at 5:08

GoogleCodeExporter commented 8 years ago
Yeah not sure what version I was looking at when I reported it.  But think I 
was referring to line 211.  As far as I can see all the "probe" code (the 
sendProbe function) does not seem to be used anymore.

I agree that moving the checks to the sendObject function would be the right 
thing to do.

Original comment by mortenthansen on 15 Jan 2011 at 3:08

GoogleCodeExporter commented 8 years ago
I applied the bug fix, moving the check within sendObject().

Original comment by philip.l...@gmail.com on 21 Jan 2011 at 5:41