mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
tcp: change type of alive from int to bool
The alive parameter of tcp_orphan_retries, indicates whether the connection is assumed alive or not. In the function and all places calling it is used as a boolean value. Therefore this changes the type of alive to bool in the function definition and all calling locations. Since tcp_orphan_tries is a tcp_timer.c local function no change in any other file or header is necessary. Signed-off-by: Richard Sailer <richard@weltraumpflege.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3741873b4f
commit
7533ce3055
1 changed files with 3 additions and 3 deletions
|
@ -83,7 +83,7 @@ static int tcp_out_of_resources(struct sock *sk, bool do_reset)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate maximal number or retries on an orphaned socket. */
|
/* Calculate maximal number or retries on an orphaned socket. */
|
||||||
static int tcp_orphan_retries(struct sock *sk, int alive)
|
static int tcp_orphan_retries(struct sock *sk, bool alive)
|
||||||
{
|
{
|
||||||
int retries = sysctl_tcp_orphan_retries; /* May be zero. */
|
int retries = sysctl_tcp_orphan_retries; /* May be zero. */
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ static int tcp_write_timeout(struct sock *sk)
|
||||||
|
|
||||||
retry_until = sysctl_tcp_retries2;
|
retry_until = sysctl_tcp_retries2;
|
||||||
if (sock_flag(sk, SOCK_DEAD)) {
|
if (sock_flag(sk, SOCK_DEAD)) {
|
||||||
const int alive = icsk->icsk_rto < TCP_RTO_MAX;
|
const bool alive = icsk->icsk_rto < TCP_RTO_MAX;
|
||||||
|
|
||||||
retry_until = tcp_orphan_retries(sk, alive);
|
retry_until = tcp_orphan_retries(sk, alive);
|
||||||
do_reset = alive ||
|
do_reset = alive ||
|
||||||
|
@ -298,7 +298,7 @@ static void tcp_probe_timer(struct sock *sk)
|
||||||
|
|
||||||
max_probes = sysctl_tcp_retries2;
|
max_probes = sysctl_tcp_retries2;
|
||||||
if (sock_flag(sk, SOCK_DEAD)) {
|
if (sock_flag(sk, SOCK_DEAD)) {
|
||||||
const int alive = inet_csk_rto_backoff(icsk, TCP_RTO_MAX) < TCP_RTO_MAX;
|
const bool alive = inet_csk_rto_backoff(icsk, TCP_RTO_MAX) < TCP_RTO_MAX;
|
||||||
|
|
||||||
max_probes = tcp_orphan_retries(sk, alive);
|
max_probes = tcp_orphan_retries(sk, alive);
|
||||||
if (!alive && icsk->icsk_backoff >= max_probes)
|
if (!alive && icsk->icsk_backoff >= max_probes)
|
||||||
|
|
Loading…
Reference in a new issue