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
Kirill Smelkov
linux
Commits
ab92bb2f
Commit
ab92bb2f
authored
Jul 09, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp: Abstract back handling peer aliveness test into helper function.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
4aabd8ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
2 deletions
+13
-2
include/net/tcp.h
include/net/tcp.h
+1
-0
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ipv4.c
+1
-1
net/ipv4/tcp_metrics.c
net/ipv4/tcp_metrics.c
+10
-0
net/ipv6/tcp_ipv6.c
net/ipv6/tcp_ipv6.c
+1
-1
No files found.
include/net/tcp.h
View file @
ab92bb2f
...
...
@@ -389,6 +389,7 @@ extern void tcp_enter_loss(struct sock *sk, int how);
extern
void
tcp_clear_retrans
(
struct
tcp_sock
*
tp
);
extern
void
tcp_update_metrics
(
struct
sock
*
sk
);
extern
void
tcp_init_metrics
(
struct
sock
*
sk
);
extern
bool
tcp_peer_is_proven
(
struct
request_sock
*
req
,
struct
dst_entry
*
dst
);
extern
void
tcp_disable_fack
(
struct
tcp_sock
*
tp
);
extern
void
tcp_close
(
struct
sock
*
sk
,
long
timeout
);
extern
void
tcp_init_sock
(
struct
sock
*
sk
);
...
...
net/ipv4/tcp_ipv4.c
View file @
ab92bb2f
...
...
@@ -1405,7 +1405,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
(
sysctl_max_syn_backlog
-
inet_csk_reqsk_queue_len
(
sk
)
<
(
sysctl_max_syn_backlog
>>
2
))
&&
(
!
peer
||
!
peer
->
tcp_ts_stamp
)
&&
(
!
dst
||
!
dst_metric
(
dst
,
RTAX_RTT
)
))
{
!
tcp_peer_is_proven
(
req
,
dst
))
{
/* Without syncookies last quarter of
* backlog is filled with destinations,
* proven to be alive.
...
...
net/ipv4/tcp_metrics.c
View file @
ab92bb2f
#include <linux/module.h>
#include <linux/cache.h>
#include <linux/tcp.h>
#include <net/inet_connection_sock.h>
#include <net/request_sock.h>
#include <net/sock.h>
#include <net/dst.h>
#include <net/tcp.h>
...
...
@@ -190,3 +192,11 @@ void tcp_init_metrics(struct sock *sk)
tp
->
snd_cwnd
=
tcp_init_cwnd
(
tp
,
dst
);
tp
->
snd_cwnd_stamp
=
tcp_time_stamp
;
}
bool
tcp_peer_is_proven
(
struct
request_sock
*
req
,
struct
dst_entry
*
dst
)
{
if
(
!
dst
)
return
false
;
return
dst_metric
(
dst
,
RTAX_RTT
)
?
true
:
false
;
}
EXPORT_SYMBOL_GPL
(
tcp_peer_is_proven
);
net/ipv6/tcp_ipv6.c
View file @
ab92bb2f
...
...
@@ -1177,7 +1177,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
(
sysctl_max_syn_backlog
-
inet_csk_reqsk_queue_len
(
sk
)
<
(
sysctl_max_syn_backlog
>>
2
))
&&
(
!
peer
||
!
peer
->
tcp_ts_stamp
)
&&
(
!
dst
||
!
dst_metric
(
dst
,
RTAX_RTT
)
))
{
!
tcp_peer_is_proven
(
req
,
dst
))
{
/* Without syncookies last quarter of
* backlog is filled with destinations,
* proven to be alive.
...
...
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