tcp: (whitespace only) fix confusing indentation
The indentation in part of tcp_minisocks makes it look like one of the if statements is much more important than it actually is. Signed-off-by: Adam Langley <agl@imperialviolet.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
827ebd6410
Коммит
2aaab9a0cc
|
@ -618,89 +618,87 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
|
||||||
/* In sequence, PAWS is OK. */
|
/* In sequence, PAWS is OK. */
|
||||||
|
|
||||||
if (tmp_opt.saw_tstamp && !after(TCP_SKB_CB(skb)->seq, tcp_rsk(req)->rcv_isn + 1))
|
if (tmp_opt.saw_tstamp && !after(TCP_SKB_CB(skb)->seq, tcp_rsk(req)->rcv_isn + 1))
|
||||||
req->ts_recent = tmp_opt.rcv_tsval;
|
req->ts_recent = tmp_opt.rcv_tsval;
|
||||||
|
|
||||||
if (TCP_SKB_CB(skb)->seq == tcp_rsk(req)->rcv_isn) {
|
if (TCP_SKB_CB(skb)->seq == tcp_rsk(req)->rcv_isn) {
|
||||||
/* Truncate SYN, it is out of window starting
|
/* Truncate SYN, it is out of window starting
|
||||||
at tcp_rsk(req)->rcv_isn + 1. */
|
at tcp_rsk(req)->rcv_isn + 1. */
|
||||||
flg &= ~TCP_FLAG_SYN;
|
flg &= ~TCP_FLAG_SYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RFC793: "second check the RST bit" and
|
/* RFC793: "second check the RST bit" and
|
||||||
* "fourth, check the SYN bit"
|
* "fourth, check the SYN bit"
|
||||||
*/
|
*/
|
||||||
if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {
|
if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {
|
||||||
TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS);
|
TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS);
|
||||||
goto embryonic_reset;
|
goto embryonic_reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACK sequence verified above, just make sure ACK is
|
/* ACK sequence verified above, just make sure ACK is
|
||||||
* set. If ACK not set, just silently drop the packet.
|
* set. If ACK not set, just silently drop the packet.
|
||||||
*/
|
*/
|
||||||
if (!(flg & TCP_FLAG_ACK))
|
if (!(flg & TCP_FLAG_ACK))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* If TCP_DEFER_ACCEPT is set, drop bare ACK. */
|
/* If TCP_DEFER_ACCEPT is set, drop bare ACK. */
|
||||||
if (inet_csk(sk)->icsk_accept_queue.rskq_defer_accept &&
|
if (inet_csk(sk)->icsk_accept_queue.rskq_defer_accept &&
|
||||||
TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) {
|
TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) {
|
||||||
inet_rsk(req)->acked = 1;
|
inet_rsk(req)->acked = 1;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OK, ACK is valid, create big socket and
|
/* OK, ACK is valid, create big socket and
|
||||||
* feed this segment to it. It will repeat all
|
* feed this segment to it. It will repeat all
|
||||||
* the tests. THIS SEGMENT MUST MOVE SOCKET TO
|
* the tests. THIS SEGMENT MUST MOVE SOCKET TO
|
||||||
* ESTABLISHED STATE. If it will be dropped after
|
* ESTABLISHED STATE. If it will be dropped after
|
||||||
* socket is created, wait for troubles.
|
* socket is created, wait for troubles.
|
||||||
*/
|
*/
|
||||||
child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb,
|
child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, req, NULL);
|
||||||
req, NULL);
|
if (child == NULL)
|
||||||
if (child == NULL)
|
goto listen_overflow;
|
||||||
goto listen_overflow;
|
|
||||||
#ifdef CONFIG_TCP_MD5SIG
|
#ifdef CONFIG_TCP_MD5SIG
|
||||||
else {
|
else {
|
||||||
/* Copy over the MD5 key from the original socket */
|
/* Copy over the MD5 key from the original socket */
|
||||||
struct tcp_md5sig_key *key;
|
struct tcp_md5sig_key *key;
|
||||||
struct tcp_sock *tp = tcp_sk(sk);
|
struct tcp_sock *tp = tcp_sk(sk);
|
||||||
key = tp->af_specific->md5_lookup(sk, child);
|
key = tp->af_specific->md5_lookup(sk, child);
|
||||||
if (key != NULL) {
|
if (key != NULL) {
|
||||||
/*
|
/*
|
||||||
* We're using one, so create a matching key on the
|
* We're using one, so create a matching key on the
|
||||||
* newsk structure. If we fail to get memory then we
|
* newsk structure. If we fail to get memory then we
|
||||||
* end up not copying the key across. Shucks.
|
* end up not copying the key across. Shucks.
|
||||||
*/
|
*/
|
||||||
char *newkey = kmemdup(key->key, key->keylen,
|
char *newkey = kmemdup(key->key, key->keylen,
|
||||||
GFP_ATOMIC);
|
GFP_ATOMIC);
|
||||||
if (newkey) {
|
if (newkey) {
|
||||||
if (!tcp_alloc_md5sig_pool())
|
if (!tcp_alloc_md5sig_pool())
|
||||||
BUG();
|
BUG();
|
||||||
tp->af_specific->md5_add(child, child,
|
tp->af_specific->md5_add(child, child, newkey,
|
||||||
newkey,
|
key->keylen);
|
||||||
key->keylen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inet_csk_reqsk_queue_unlink(sk, req, prev);
|
inet_csk_reqsk_queue_unlink(sk, req, prev);
|
||||||
inet_csk_reqsk_queue_removed(sk, req);
|
inet_csk_reqsk_queue_removed(sk, req);
|
||||||
|
|
||||||
inet_csk_reqsk_queue_add(sk, req, child);
|
inet_csk_reqsk_queue_add(sk, req, child);
|
||||||
return child;
|
return child;
|
||||||
|
|
||||||
listen_overflow:
|
listen_overflow:
|
||||||
if (!sysctl_tcp_abort_on_overflow) {
|
if (!sysctl_tcp_abort_on_overflow) {
|
||||||
inet_rsk(req)->acked = 1;
|
inet_rsk(req)->acked = 1;
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
embryonic_reset:
|
|
||||||
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
|
|
||||||
if (!(flg & TCP_FLAG_RST))
|
|
||||||
req->rsk_ops->send_reset(sk, skb);
|
|
||||||
|
|
||||||
inet_csk_reqsk_queue_drop(sk, req, prev);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
embryonic_reset:
|
||||||
|
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
|
||||||
|
if (!(flg & TCP_FLAG_RST))
|
||||||
|
req->rsk_ops->send_reset(sk, skb);
|
||||||
|
|
||||||
|
inet_csk_reqsk_queue_drop(sk, req, prev);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче