Skip to contentSkip to conversation

tcp: remove useless assignment statement in tcp_keepalive_timer

PATCH In review Li Yu 2 participants 3 messages Aug 22, 2011

Subsystems (3)
lore
Share & tools
lore

Li Yu

author
#0 lore raw

PATCH 1/1 tcp: remove useless assignment statement in tcp_keepalive_timer

Remove useless assignment statement, it may be trash after refactoring?

net/ipv4/tcp_timer.c +0 -2
index ecd44b0..321ff2f 100644
@@ -552,8 +552,6 @@ static void tcp_keepalive_timer (unsigned long data)
 	if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE)
 		goto out;
 
-	elapsed = keepalive_time_when(tp);
-
 	/* It is alive without keepalive 8) */
 	if (tp->packets_out || tcp_send_head(sk))
 		goto resched;
#1 lore raw

No, if the condition afterwards evaluates to TRUE, and we go to the label resched, inet_csk_reset_keepalive_timer(...) is called without elapsed being set.

Cheers,
Christoph

On Monday 22 August 2011 wrote Li Yu:

Quoted 18 lines

Remove useless assignment statement, it may be trash after refactoring?

net/ipv4/tcp_timer.c +0 -3
index ecd44b0..321ff2f 100644
@@ -552,8 +552,6 @@ static void tcp_keepalive_timer (unsigned long data)
 	if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE)
 		goto out;
 
-	elapsed = keepalive_time_when(tp);
-
 	/* It is alive without keepalive 8) */
 	if (tp->packets_out || tcp_send_head(sk))
 		goto resched;
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

author
#2 lore raw

Oops, thanks for reminding !

Yu

Quoted 41 lines · Christoph Paasch

No, if the condition afterwards evaluates to TRUE, and we go to the label resched, inet_csk_reset_keepalive_timer(...) is called without elapsed being set.

Cheers,
Christoph

On Monday 22 August 2011 wrote Li Yu:

Quoted 18 lines

Remove useless assignment statement, it may be trash after refactoring?

net/ipv4/tcp_timer.c +0 -3
index ecd44b0..321ff2f 100644
@@ -552,8 +552,6 @@ static void tcp_keepalive_timer (unsigned long data)
 	if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE)
 		goto out;
 
-	elapsed = keepalive_time_when(tp);
-
 	/* It is alive without keepalive 8) */
 	if (tp->packets_out || tcp_send_head(sk))
 		goto resched;
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--