Patchwork [net-next,11/17] htcp: merge icsk_ca_state compare

login
register
mail settings
Submitter Ilpo Järvinen
Date Feb. 28, 2009, 2:44 p.m.
Message ID <1235832283214-git-send-email-ilpo.jarvinen@helsinki.fi>
Download mbox | patch
Permalink /patch/23889/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ilpo Järvinen - Feb. 28, 2009, 2:44 p.m.
From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Similar to what is done elsewhere in TCP code when double
state checks are being done.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 net/ipv4/tcp_htcp.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
David Miller - March 2, 2009, 11:02 a.m.
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Sat, 28 Feb 2009 16:44:36 +0200

> From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> 
> Similar to what is done elsewhere in TCP code when double
> state checks are being done.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

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

Patch

diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index 937549b..9520eec 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -115,8 +115,7 @@  static void measure_achieved_throughput(struct sock *sk, u32 pkts_acked, s32 rtt
 		return;
 
 	/* achieved throughput calculations */
-	if (icsk->icsk_ca_state != TCP_CA_Open &&
-	    icsk->icsk_ca_state != TCP_CA_Disorder) {
+	if (!((1 << icsk->icsk_ca_state) & (TCPF_CA_Open | TCPF_CA_Disorder))) {
 		ca->packetcount = 0;
 		ca->lasttime = now;
 		return;