Skip to content

Commit 7533ce3

Browse files
Richard Sailerdavem330
authored andcommitted
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>
1 parent 3741873 commit 7533ce3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/ipv4/tcp_timer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int tcp_out_of_resources(struct sock *sk, bool do_reset)
8383
}
8484

8585
/* Calculate maximal number or retries on an orphaned socket. */
86-
static int tcp_orphan_retries(struct sock *sk, int alive)
86+
static int tcp_orphan_retries(struct sock *sk, bool alive)
8787
{
8888
int retries = sysctl_tcp_orphan_retries; /* May be zero. */
8989

@@ -184,7 +184,7 @@ static int tcp_write_timeout(struct sock *sk)
184184

185185
retry_until = sysctl_tcp_retries2;
186186
if (sock_flag(sk, SOCK_DEAD)) {
187-
const int alive = icsk->icsk_rto < TCP_RTO_MAX;
187+
const bool alive = icsk->icsk_rto < TCP_RTO_MAX;
188188

189189
retry_until = tcp_orphan_retries(sk, alive);
190190
do_reset = alive ||
@@ -298,7 +298,7 @@ static void tcp_probe_timer(struct sock *sk)
298298

299299
max_probes = sysctl_tcp_retries2;
300300
if (sock_flag(sk, SOCK_DEAD)) {
301-
const int alive = inet_csk_rto_backoff(icsk, TCP_RTO_MAX) < TCP_RTO_MAX;
301+
const bool alive = inet_csk_rto_backoff(icsk, TCP_RTO_MAX) < TCP_RTO_MAX;
302302

303303
max_probes = tcp_orphan_retries(sk, alive);
304304
if (!alive && icsk->icsk_backoff >= max_probes)

0 commit comments

Comments
 (0)