From 3c5a63a78adeec716e64b0d66b05359934c7d16e Mon Sep 17 00:00:00 2001
From: A-star-ayush <myselfthebest@yahoo.com>
Date: Wed, 26 Jul 2017 01:14:45 +0530
Subject: [PATCH] tcp: rfc 7323: added PAWS timestamp check on Receive
---
src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp
index 0a7c5fa..4ab6cdb 100644
a
|
b
|
TCPEndpoint::_SynchronizeSentReceive(tcp_segment_header &segment,
|
1523 | 1523 | int32 |
1524 | 1524 | TCPEndpoint::_Receive(tcp_segment_header& segment, net_buffer* buffer) |
1525 | 1525 | { |
| 1526 | // PAWS processing takes precedence over regular TCP acceptability check |
| 1527 | if (fFlags & FLAG_OPTION_TIMESTAMP && (segment.flags & TCP_FLAG_RESET == 0)) { |
| 1528 | if ((segment.options & TCP_HAS_TIMESTAMPS) == 0) |
| 1529 | return DROP; |
| 1530 | if (segment.timestamp_value < fReceivedTimestamp) |
| 1531 | return DROP | IMMEDIATE_ACKNOWLEDGE; |
| 1532 | } |
| 1533 | |
1526 | 1534 | uint32 advertisedWindow = (uint32)segment.advertised_window |
1527 | 1535 | << fSendWindowShift; |
1528 | 1536 | size_t segmentLength = buffer->size; |