mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 21:13:44 +02:00
updated comment
This commit is contained in:
parent
fb20bbc538
commit
402cf69b72
1 changed files with 2 additions and 2 deletions
|
@ -95,8 +95,8 @@ impl CounterWindow {
|
|||
|
||||
#[inline(always)]
|
||||
pub fn message_authenticated(&self, received_counter_value: u32) -> bool {
|
||||
//if a valid message is received but one of its fragments was lost, it can technically be replayed, since the message is incomplete, we know it still exists in the gather array, so the gather array will deduplicate the replayed message
|
||||
//eventually the counter of that message will be too OOO to be accepted anymore so it can't be used to DOS
|
||||
//if a valid message is received but one of its fragments was lost, it can technically be replayed. However since the message is incomplete, we know it still exists in the gather array, so the gather array will deduplicate the replayed message. Even if the gather array gets flushed, that flush still effectively deduplicates the replayed message.
|
||||
//eventually the counter of that kind of message will be too OOO to be accepted anymore so it can't be used to DOS.
|
||||
let idx = (received_counter_value % COUNTER_MAX_ALLOWED_OOO as u32) as usize;
|
||||
if self.1.swap((u32::MAX/4 < received_counter_value) & (received_counter_value <= u32::MAX/4*3), Ordering::SeqCst) {
|
||||
return self.2[idx].fetch_max(received_counter_value, Ordering::SeqCst) < received_counter_value;
|
||||
|
|
Loading…
Add table
Reference in a new issue