tcp: get rid of rst_seq_match
Small cleanup in tcp_validate_incoming(), no need for rst_seq_match setting and testing. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d9d024f966
commit
b5ec1e6205
@@ -5667,7 +5667,6 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
|
|||||||
const struct tcphdr *th, int syn_inerr)
|
const struct tcphdr *th, int syn_inerr)
|
||||||
{
|
{
|
||||||
struct tcp_sock *tp = tcp_sk(sk);
|
struct tcp_sock *tp = tcp_sk(sk);
|
||||||
bool rst_seq_match = false;
|
|
||||||
|
|
||||||
/* RFC1323: H1. Apply PAWS check first. */
|
/* RFC1323: H1. Apply PAWS check first. */
|
||||||
if (tcp_fast_parse_options(sock_net(sk), skb, th, tp) &&
|
if (tcp_fast_parse_options(sock_net(sk), skb, th, tp) &&
|
||||||
@@ -5717,9 +5716,10 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
|
|||||||
* Send a challenge ACK
|
* Send a challenge ACK
|
||||||
*/
|
*/
|
||||||
if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt ||
|
if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt ||
|
||||||
tcp_reset_check(sk, skb)) {
|
tcp_reset_check(sk, skb))
|
||||||
rst_seq_match = true;
|
goto reset;
|
||||||
} else if (tcp_is_sack(tp) && tp->rx_opt.num_sacks > 0) {
|
|
||||||
|
if (tcp_is_sack(tp) && tp->rx_opt.num_sacks > 0) {
|
||||||
struct tcp_sack_block *sp = &tp->selective_acks[0];
|
struct tcp_sack_block *sp = &tp->selective_acks[0];
|
||||||
int max_sack = sp[0].end_seq;
|
int max_sack = sp[0].end_seq;
|
||||||
int this_sack;
|
int this_sack;
|
||||||
@@ -5732,12 +5732,9 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (TCP_SKB_CB(skb)->seq == max_sack)
|
if (TCP_SKB_CB(skb)->seq == max_sack)
|
||||||
rst_seq_match = true;
|
goto reset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rst_seq_match)
|
|
||||||
goto reset;
|
|
||||||
|
|
||||||
/* Disable TFO if RST is out-of-order
|
/* Disable TFO if RST is out-of-order
|
||||||
* and no data has been received
|
* and no data has been received
|
||||||
* for current active TFO socket
|
* for current active TFO socket
|
||||||
|
|||||||
Reference in New Issue
Block a user