diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-04-07 16:41:28 +0000 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-04-07 16:41:28 +0000 |
| commit | 9085a04b165dc2a2c7c77091e507fdd98757d363 (patch) | |
| tree | 51790b8db47bfd8ad39b800bd365cf3d8b122466 /node/Switch.hpp | |
| parent | c7df61a3c32d66b31f047602da9ce982164c6757 (diff) | |
| parent | c278f051817719fc3c4bbda0e13c279ce44f0966 (diff) | |
| download | infinitytier-9085a04b165dc2a2c7c77091e507fdd98757d363.tar.gz infinitytier-9085a04b165dc2a2c7c77091e507fdd98757d363.zip | |
Merge branch 'dev' of http://git.int.zerotier.com:/zerotier/ZeroTierOne into dev
Diffstat (limited to 'node/Switch.hpp')
| -rw-r--r-- | node/Switch.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/node/Switch.hpp b/node/Switch.hpp index 219bfb41..ce4f00a1 100644 --- a/node/Switch.hpp +++ b/node/Switch.hpp @@ -184,7 +184,7 @@ private: /* Returns the matching or oldest entry. Caller must check timestamp and * packet ID to determine which. */ - inline RXQueueEntry *_findRXQueueEntry(uint64_t packetId) + inline RXQueueEntry *_findRXQueueEntry(uint64_t now,uint64_t packetId) { RXQueueEntry *rq; RXQueueEntry *oldest = &(_rxQueue[ZT_RX_QUEUE_SIZE - 1]); @@ -193,6 +193,8 @@ private: rq = &(_rxQueue[--i]); if ((rq->packetId == packetId)&&(rq->timestamp)) return rq; + if ((now - rq->timestamp) >= ZT_RX_QUEUE_EXPIRE) + rq->timestamp = 0; if (rq->timestamp < oldest->timestamp) oldest = rq; } |
