netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1][TCP]: break missing at end of switch statement
@ 2007-10-01 12:32 Gerrit Renker
  2007-10-01 12:34 ` Al Viro
  2007-10-01 13:20 ` YOSHIFUJI Hideaki
  0 siblings, 2 replies; 8+ messages in thread
From: Gerrit Renker @ 2007-10-01 12:32 UTC (permalink / raw)
  To: netdev

[TCP]: break missing at end of switch statement

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
 			return;
 		default:
 			sk->sk_err = ECONNRESET;
+			break;
 	}
 
 	if (!sock_flag(sk, SOCK_DEAD))

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 12:32 [PATCH 1/1][TCP]: break missing at end of switch statement Gerrit Renker
@ 2007-10-01 12:34 ` Al Viro
  2007-10-01 13:02   ` Gerrit Renker
  2007-10-01 13:20 ` YOSHIFUJI Hideaki
  1 sibling, 1 reply; 8+ messages in thread
From: Al Viro @ 2007-10-01 12:34 UTC (permalink / raw)
  To: Gerrit Renker; +Cc: netdev

On Mon, Oct 01, 2007 at 01:32:43PM +0100, Gerrit Renker wrote:
> [TCP]: break missing at end of switch statement
> 
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> ---
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
>  			return;
>  		default:
>  			sk->sk_err = ECONNRESET;
> +			break;
>  	}

Huh?  Why on the Earth would that be a problem?

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 12:34 ` Al Viro
@ 2007-10-01 13:02   ` Gerrit Renker
  2007-10-01 13:17     ` Al Viro
  0 siblings, 1 reply; 8+ messages in thread
From: Gerrit Renker @ 2007-10-01 13:02 UTC (permalink / raw)
  To: Al Viro; +Cc: netdev

Quoting Al Viro:
|  On Mon, Oct 01, 2007 at 01:32:43PM +0100, Gerrit Renker wrote:
|  > [TCP]: break missing at end of switch statement
|  > 
|  > Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
|  > ---
|  > --- a/net/ipv4/tcp_input.c
|  > +++ b/net/ipv4/tcp_input.c
|  > @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
|  >  			return;
|  >  		default:
|  >  			sk->sk_err = ECONNRESET;
|  > +			break;
|  >  	}
|  
|  Huh?  Why on the Earth would that be a problem?
|  
|  
Sorry what is your question?

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 13:02   ` Gerrit Renker
@ 2007-10-01 13:17     ` Al Viro
  0 siblings, 0 replies; 8+ messages in thread
From: Al Viro @ 2007-10-01 13:17 UTC (permalink / raw)
  To: Gerrit Renker; +Cc: netdev

On Mon, Oct 01, 2007 at 02:02:10PM +0100, Gerrit Renker wrote:
> Quoting Al Viro:
> |  On Mon, Oct 01, 2007 at 01:32:43PM +0100, Gerrit Renker wrote:
> |  > [TCP]: break missing at end of switch statement
> |  > 
> |  > Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> |  > ---
> |  > --- a/net/ipv4/tcp_input.c
> |  > +++ b/net/ipv4/tcp_input.c
> |  > @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
> |  >  			return;
> |  >  		default:
> |  >  			sk->sk_err = ECONNRESET;
> |  > +			break;
> |  >  	}
> |  
> |  Huh?  Why on the Earth would that be a problem?
> |  
> |  
> Sorry what is your question?

Why the hell is $Subject a problem that warrants any patches whatsoever?

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 12:32 [PATCH 1/1][TCP]: break missing at end of switch statement Gerrit Renker
  2007-10-01 12:34 ` Al Viro
@ 2007-10-01 13:20 ` YOSHIFUJI Hideaki
  2007-10-01 13:39   ` Gerrit Renker
  1 sibling, 1 reply; 8+ messages in thread
From: YOSHIFUJI Hideaki @ 2007-10-01 13:20 UTC (permalink / raw)
  To: gerrit; +Cc: netdev, yoshfuji

In article <200710011332.43657@strip-the-willow> (at Mon, 1 Oct 2007 13:32:43 +0100), Gerrit Renker <gerrit@erg.abdn.ac.uk> says:

> [TCP]: break missing at end of switch statement
> 
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> ---
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
>  			return;
>  		default:
>  			sk->sk_err = ECONNRESET;
> +			break;
>  	}
>  
>  	if (!sock_flag(sk, SOCK_DEAD))

NAK; it is not required at all.

--yoshfuji

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 13:20 ` YOSHIFUJI Hideaki
@ 2007-10-01 13:39   ` Gerrit Renker
  2007-10-01 14:31     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Gerrit Renker @ 2007-10-01 13:39 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev, yoshfuji

Quoting YOSHIFUJI Hideaki:
| 
|  > [TCP]: break missing at end of switch statement
|  > 
|  > Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
|  > ---
|  > --- a/net/ipv4/tcp_input.c
|  > +++ b/net/ipv4/tcp_input.c
|  > @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
|  >  			return;
|  >  		default:
|  >  			sk->sk_err = ECONNRESET;
|  > +			break;
|  >  	}
|  >  
|  >  	if (!sock_flag(sk, SOCK_DEAD))
|  
|  NAK; it is not required at all.
|  
|  --yoshfuji
|  
If it were true what you are saying then the statement 

       `sk->sk_err = ECONNRESET;' 

can go as well since it will always be overridden.

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 13:39   ` Gerrit Renker
@ 2007-10-01 14:31     ` Arnaldo Carvalho de Melo
  2007-10-01 17:25       ` Gerrit Renker
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-10-01 14:31 UTC (permalink / raw)
  To: Gerrit Renker; +Cc: YOSHIFUJI Hideaki, netdev, yoshfuji

Em Mon, Oct 01, 2007 at 02:39:28PM +0100, Gerrit Renker escreveu:
> Quoting YOSHIFUJI Hideaki:
> | 
> |  > [TCP]: break missing at end of switch statement
> |  > 
> |  > Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
> |  > ---
> |  > --- a/net/ipv4/tcp_input.c
> |  > +++ b/net/ipv4/tcp_input.c
> |  > @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
> |  >  			return;
> |  >  		default:
> |  >  			sk->sk_err = ECONNRESET;
> |  > +			break;
> |  >  	}
> |  >  
> |  >  	if (!sock_flag(sk, SOCK_DEAD))
> |  
> |  NAK; it is not required at all.
> |  
> |  --yoshfuji
> |  
> If it were true what you are saying then the statement 
> 
>        `sk->sk_err = ECONNRESET;' 
> 
> can go as well since it will always be overridden.

Gerrit,

        It is not required. The statement you mention will be executed
when the sk_state is not one of TCP_SYN_SENT, TCP_CLOSE_WAIT or
TCP_CLOSE.

	A 'break' is only needed in a label block if it is not the last
one.

- Arnaldo

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

* Re: [PATCH 1/1][TCP]: break missing at end of switch statement
  2007-10-01 14:31     ` Arnaldo Carvalho de Melo
@ 2007-10-01 17:25       ` Gerrit Renker
  0 siblings, 0 replies; 8+ messages in thread
From: Gerrit Renker @ 2007-10-01 17:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: YOSHIFUJI Hideaki, netdev

Arnaldo, Al Viro, and Yoshifuji -

sorry for having wasted your time with this one. You are right, that was complete nonsense. 
I don't know where my mind was - even my test program used to `prove' this was screwed up.

So nothing wrong here and thank you very much for your clarifying comments.

|  > |  > --- a/net/ipv4/tcp_input.c
|  > |  > +++ b/net/ipv4/tcp_input.c
|  > |  > @@ -3129,6 +3129,7 @@ static void tcp_reset(struct sock *sk)
|  > |  >  			return;
|  > |  >  		default:
|  > |  >  			sk->sk_err = ECONNRESET;
|  > |  > +			break;
|  > |  >  	}
|  > |  >  
|  > |  >  	if (!sock_flag(sk, SOCK_DEAD))
|  > |  
|  > |  NAK; it is not required at all.
|  > |  
|  > |  --yoshfuji
|  > |  
|  > If it were true what you are saying then the statement 
|  > 
|  >        `sk->sk_err = ECONNRESET;' 
|  > 
|  > can go as well since it will always be overridden.
|  
|  Gerrit,
|  
|          It is not required. The statement you mention will be executed
|  when the sk_state is not one of TCP_SYN_SENT, TCP_CLOSE_WAIT or
|  TCP_CLOSE.
|  
|  	A 'break' is only needed in a label block if it is not the last
|  one.
|  
|  - Arnaldo
|  
|  

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

end of thread, other threads:[~2007-10-01 17:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-01 12:32 [PATCH 1/1][TCP]: break missing at end of switch statement Gerrit Renker
2007-10-01 12:34 ` Al Viro
2007-10-01 13:02   ` Gerrit Renker
2007-10-01 13:17     ` Al Viro
2007-10-01 13:20 ` YOSHIFUJI Hideaki
2007-10-01 13:39   ` Gerrit Renker
2007-10-01 14:31     ` Arnaldo Carvalho de Melo
2007-10-01 17:25       ` Gerrit Renker

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).