* added randomisation to package killing in meshGetMessage

(cherry picked from commit dd67ddd708a8a5eada1a8b6cbd5afe51c6f4a134)

Signed-off-by: Stefan `Sec` Zehl <sec@42.org>
This commit is contained in:
Steve Dierker 2011-12-28 21:14:55 +00:00 committed by Stefan `Sec` Zehl
parent 1554d114d1
commit b7726b592a
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ MPKT * meshGetMessage(uint8_t type){
}; };
}; };
if(free==-1){ // Buffer full. Ah well. Kill a random packet if(free==-1){ // Buffer full. Ah well. Kill a random packet
free=1; // XXX: GetRandom()? free= (int)(getRandom() % MESHBUFSIZE);
meshbuffer[free].flags=MF_FREE; meshbuffer[free].flags=MF_FREE;
}; };
if(meshbuffer[free].flags==MF_FREE){ if(meshbuffer[free].flags==MF_FREE){