netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rfc] suspicious indentation in do_tcp_setsockopt
@ 2013-09-05  4:20 Dave Jones
  2013-09-05  4:39 ` David Miller
  2013-09-05  4:43 ` Joe Perches
  0 siblings, 2 replies; 8+ messages in thread
From: Dave Jones @ 2013-09-05  4:20 UTC (permalink / raw)
  To: netdev

What's the intent here ?

This ?


diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b2f6c74..95544e4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2454,10 +2454,11 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 	case TCP_THIN_DUPACK:
 		if (val < 0 || val > 1)
 			err = -EINVAL;
-		else
+		else {
 			tp->thin_dupack = val;
 			if (tp->thin_dupack)
 				tcp_disable_early_retrans(tp);
+		}
 		break;
 
 	case TCP_REPAIR:

Or this ...

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b2f6c74..187c5a4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2456,8 +2456,9 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 			err = -EINVAL;
 		else
 			tp->thin_dupack = val;
-			if (tp->thin_dupack)
-				tcp_disable_early_retrans(tp);
+
+		if (tp->thin_dupack)
+			tcp_disable_early_retrans(tp);
 		break;
 
 	case TCP_REPAIR:


I'll submit the right patch in the right form once I know what was intended.

The former seems more 'correct' to me, but I'm unsure if that could break something.

	Dave

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-05 17:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05  4:20 [rfc] suspicious indentation in do_tcp_setsockopt Dave Jones
2013-09-05  4:39 ` David Miller
2013-09-05  4:43   ` Dave Jones
2013-09-05  4:53     ` Joe Perches
2013-09-05  7:42     ` Daniel Borkmann
2013-09-05  4:43 ` Joe Perches
2013-09-05 17:24   ` Neal Cardwell
2013-09-05 17:34     ` Yuchung Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).