提交 c337578a 编写于 作者: E Eric Dumazet 提交者: David S. Miller

tcp: make tcp_rcv_synsent_state_process() drop monitor friend

1) A valid RST packet should be consumed, to not confuse drop monitor.

2) Same remark for packet validating cross syn setup,
   even if we might ignore part of it.

3) When third packet of 3WHS is delayed, do not pretend
   the SYNACK was dropped.
Signed-off-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e7c89ae4
...@@ -6186,7 +6186,9 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, ...@@ -6186,7 +6186,9 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
if (th->rst) { if (th->rst) {
tcp_reset(sk, skb); tcp_reset(sk, skb);
goto discard; consume:
__kfree_skb(skb);
return 0;
} }
/* rfc793: /* rfc793:
...@@ -6275,13 +6277,9 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, ...@@ -6275,13 +6277,9 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS); tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);
inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
TCP_DELACK_MAX, TCP_RTO_MAX); TCP_DELACK_MAX, TCP_RTO_MAX);
goto consume;
discard:
tcp_drop(sk, skb);
return 0;
} else {
tcp_send_ack(sk);
} }
tcp_send_ack(sk);
return -1; return -1;
} }
...@@ -6350,7 +6348,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, ...@@ -6350,7 +6348,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
*/ */
return -1; return -1;
#else #else
goto discard; goto consume;
#endif #endif
} }
/* "fifth, if neither of the SYN or RST bits is set then /* "fifth, if neither of the SYN or RST bits is set then
...@@ -6360,7 +6358,8 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, ...@@ -6360,7 +6358,8 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
discard_and_undo: discard_and_undo:
tcp_clear_options(&tp->rx_opt); tcp_clear_options(&tp->rx_opt);
tp->rx_opt.mss_clamp = saved_clamp; tp->rx_opt.mss_clamp = saved_clamp;
goto discard; tcp_drop(sk, skb);
return 0;
reset_and_undo: reset_and_undo:
tcp_clear_options(&tp->rx_opt); tcp_clear_options(&tp->rx_opt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册