lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 09 Aug 2013 11:12:29 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	tingw.liu@...il.com
Cc:	netdev@...r.kernel.org, kuznet@....inr.ac.ru,
	eric.dumazet@...il.com
Subject: Re: [PATCH net-next] tcp:elapsed variable calculated twice while
 keepalive working

From: Tingwei Liu <tingw.liu@...il.com>
Date: Tue,  6 Aug 2013 20:38:58 +0800

> When tcp keepalive working elapsed calculated twice while the first time is not needed!
> 
> CC: Eric Dumazet <eric.dumazet@...il.com>
> CC: Alexey Kuznetsov <kuznet@....inr.ac.ru>
> Signed-off-by: Tingwei Liu <tingw.liu@...il.com>


Please put a space after "tcp:" in your Subject line prefixes, it looks
awful the way you've done it here.

> @@ -591,11 +591,11 @@ 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))
> +	if (tp->packets_out || tcp_send_head(sk)) {
> +		elapsed = keepalive_time_when(tp);
>  		goto resched;
> +	}
>  
>  	elapsed = keepalive_time_elapsed(tp);

This is overkill, just delete the second assignment.  Your version makes
the code look less elegant and also makes it harder to audit.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ