Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
b178f368
Commit
b178f368
authored
Sep 08, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TCP]: Delay tstamp state commit in input fast path until we verify csum.
parent
ffedcefb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
net/ipv4/tcp_input.c
net/ipv4/tcp_input.c
+30
-5
No files found.
net/ipv4/tcp_input.c
View file @
b178f368
...
...
@@ -3289,17 +3289,24 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
if
((
s32
)(
tp
->
rcv_tsval
-
tp
->
ts_recent
)
<
0
)
goto
slow_path
;
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
/* DO NOT update ts_recent here, if checksum fails
* and timestamp was corrupted part, it will result
* in a hung connection since we will drop all
* future packets due to the PAWS test.
*/
if
(
tp
->
rcv_nxt
==
tp
->
rcv_wup
)
tcp_store_ts_recent
(
tp
);
}
if
(
len
<=
tcp_header_len
)
{
/* Bulk data transfer: sender */
if
(
len
==
tcp_header_len
)
{
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
*/
if
(
tcp_header_len
==
(
sizeof
(
struct
tcphdr
)
+
TCPOLEN_TSTAMP_ALIGNED
)
&&
tp
->
rcv_nxt
==
tp
->
rcv_wup
)
tcp_store_ts_recent
(
tp
);
/* We know that such packets are checksummed
* on entry.
*/
...
...
@@ -3325,12 +3332,30 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
tp
->
rcv_nxt
=
TCP_SKB_CB
(
skb
)
->
end_seq
;
NET_INC_STATS_BH
(
TCPHPHitsToUser
);
eaten
=
1
;
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
*/
if
(
tcp_header_len
==
(
sizeof
(
struct
tcphdr
)
+
TCPOLEN_TSTAMP_ALIGNED
)
&&
tp
->
rcv_nxt
==
tp
->
rcv_wup
)
tcp_store_ts_recent
(
tp
);
}
}
if
(
!
eaten
)
{
if
(
tcp_checksum_complete_user
(
sk
,
skb
))
goto
csum_error
;
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
*/
if
(
tcp_header_len
==
(
sizeof
(
struct
tcphdr
)
+
TCPOLEN_TSTAMP_ALIGNED
)
&&
tp
->
rcv_nxt
==
tp
->
rcv_wup
)
tcp_store_ts_recent
(
tp
);
if
((
int
)
skb
->
truesize
>
sk
->
forward_alloc
)
goto
step5
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment