* 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:
parent
1554d114d1
commit
b7726b592a
|
@ -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){
|
||||||
|
|
Loading…
Reference in New Issue