tcp: Remove another indentation level in tcp_rcv_state_process
case TCP_SYN_RECV: can have another indentation level removed by converting if (acceptable) { ...; } else { return 1; } to if (!acceptable) return 1; ...; Reflow code and comments to fit 80 columns. Another pure cleanup patch. Signed-off-by: Joe Perches <joe@perches.com> Improved-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1f6afc8108
commit
61eb900352
1 changed files with 54 additions and 62 deletions
|
@ -5612,9 +5612,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
|
||||||
|
|
||||||
switch (sk->sk_state) {
|
switch (sk->sk_state) {
|
||||||
case TCP_SYN_RECV:
|
case TCP_SYN_RECV:
|
||||||
if (acceptable) {
|
if (!acceptable)
|
||||||
/* Once we leave TCP_SYN_RECV, we no longer
|
return 1;
|
||||||
* need req so release it.
|
|
||||||
|
/* Once we leave TCP_SYN_RECV, we no longer need req
|
||||||
|
* so release it.
|
||||||
*/
|
*/
|
||||||
if (req) {
|
if (req) {
|
||||||
tcp_synack_rtt_meas(sk, req);
|
tcp_synack_rtt_meas(sk, req);
|
||||||
|
@ -5622,9 +5624,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
|
||||||
|
|
||||||
reqsk_fastopen_remove(sk, req, false);
|
reqsk_fastopen_remove(sk, req, false);
|
||||||
} else {
|
} else {
|
||||||
/* Make sure socket is routed, for
|
/* Make sure socket is routed, for correct metrics. */
|
||||||
* correct metrics.
|
|
||||||
*/
|
|
||||||
icsk->icsk_af_ops->rebuild_header(sk);
|
icsk->icsk_af_ops->rebuild_header(sk);
|
||||||
tcp_init_congestion_control(sk);
|
tcp_init_congestion_control(sk);
|
||||||
|
|
||||||
|
@ -5636,46 +5636,38 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
|
||||||
tcp_set_state(sk, TCP_ESTABLISHED);
|
tcp_set_state(sk, TCP_ESTABLISHED);
|
||||||
sk->sk_state_change(sk);
|
sk->sk_state_change(sk);
|
||||||
|
|
||||||
/* Note, that this wakeup is only for marginal
|
/* Note, that this wakeup is only for marginal crossed SYN case.
|
||||||
* crossed SYN case. Passively open sockets
|
* Passively open sockets are not waked up, because
|
||||||
* are not waked up, because sk->sk_sleep ==
|
* sk->sk_sleep == NULL and sk->sk_socket == NULL.
|
||||||
* NULL and sk->sk_socket == NULL.
|
|
||||||
*/
|
*/
|
||||||
if (sk->sk_socket)
|
if (sk->sk_socket)
|
||||||
sk_wake_async(sk, SOCK_WAKE_IO, POLL_OUT);
|
sk_wake_async(sk, SOCK_WAKE_IO, POLL_OUT);
|
||||||
|
|
||||||
tp->snd_una = TCP_SKB_CB(skb)->ack_seq;
|
tp->snd_una = TCP_SKB_CB(skb)->ack_seq;
|
||||||
tp->snd_wnd = ntohs(th->window) <<
|
tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale;
|
||||||
tp->rx_opt.snd_wscale;
|
|
||||||
tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
|
tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
|
||||||
|
|
||||||
if (tp->rx_opt.tstamp_ok)
|
if (tp->rx_opt.tstamp_ok)
|
||||||
tp->advmss -= TCPOLEN_TSTAMP_ALIGNED;
|
tp->advmss -= TCPOLEN_TSTAMP_ALIGNED;
|
||||||
|
|
||||||
if (req) {
|
if (req) {
|
||||||
/* Re-arm the timer because data may
|
/* Re-arm the timer because data may have been sent out.
|
||||||
* have been sent out. This is similar
|
* This is similar to the regular data transmission case
|
||||||
* to the regular data transmission case
|
|
||||||
* when new data has just been ack'ed.
|
* when new data has just been ack'ed.
|
||||||
*
|
*
|
||||||
* (TFO) - we could try to be more aggressive
|
* (TFO) - we could try to be more aggressive and
|
||||||
* and retransmitting any data sooner based
|
* retransmitting any data sooner based on when they
|
||||||
* on when they are sent out.
|
* are sent out.
|
||||||
*/
|
*/
|
||||||
tcp_rearm_rto(sk);
|
tcp_rearm_rto(sk);
|
||||||
} else
|
} else
|
||||||
tcp_init_metrics(sk);
|
tcp_init_metrics(sk);
|
||||||
|
|
||||||
/* Prevent spurious tcp_cwnd_restart() on
|
/* Prevent spurious tcp_cwnd_restart() on first data packet */
|
||||||
* first data packet.
|
|
||||||
*/
|
|
||||||
tp->lsndtime = tcp_time_stamp;
|
tp->lsndtime = tcp_time_stamp;
|
||||||
|
|
||||||
tcp_initialize_rcv_mss(sk);
|
tcp_initialize_rcv_mss(sk);
|
||||||
tcp_fast_path_on(tp);
|
tcp_fast_path_on(tp);
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TCP_FIN_WAIT1:
|
case TCP_FIN_WAIT1:
|
||||||
|
|
Loading…
Reference in a new issue