Whoops
This commit is contained in:
parent
4d03f397df
commit
1f179e8b2b
1 changed files with 6 additions and 0 deletions
|
@ -73,6 +73,12 @@ ssize_t msgid_cache_lookup(const unsigned char mac[6]) {
|
||||||
ssize_t msgid_cache_add(const unsigned char mac[6]) {
|
ssize_t msgid_cache_add(const unsigned char mac[6]) {
|
||||||
ssize_t index = next_slot++;
|
ssize_t index = next_slot++;
|
||||||
|
|
||||||
|
// If we are adding into a new slot (instead of overwriting one),
|
||||||
|
// expand the fill pointer
|
||||||
|
if (msgid_cache_fill < index) {
|
||||||
|
msgid_cache_fill++;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(msgid_cache[index].other_mac, mac, sizeof(msgid_cache[index].other_mac));
|
memcpy(msgid_cache[index].other_mac, mac, sizeof(msgid_cache[index].other_mac));
|
||||||
msgid_cache[index].know_send = false;
|
msgid_cache[index].know_send = false;
|
||||||
msgid_cache[index].know_receive = false;
|
msgid_cache[index].know_receive = false;
|
||||||
|
|
Loading…
Reference in a new issue