|
@@ -311,7 +311,7 @@ static void do_redirect(struct sk_buff *skb, struct sock *sk)
|
|
|
|
|
|
|
|
|
|
/* handle ICMP messages on TCP_NEW_SYN_RECV request sockets */
|
|
/* handle ICMP messages on TCP_NEW_SYN_RECV request sockets */
|
|
-void tcp_req_err(struct sock *sk, u32 seq)
|
|
|
|
|
|
+void tcp_req_err(struct sock *sk, u32 seq, bool abort)
|
|
{
|
|
{
|
|
struct request_sock *req = inet_reqsk(sk);
|
|
struct request_sock *req = inet_reqsk(sk);
|
|
struct net *net = sock_net(sk);
|
|
struct net *net = sock_net(sk);
|
|
@@ -323,7 +323,7 @@ void tcp_req_err(struct sock *sk, u32 seq)
|
|
|
|
|
|
if (seq != tcp_rsk(req)->snt_isn) {
|
|
if (seq != tcp_rsk(req)->snt_isn) {
|
|
NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
|
|
NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS);
|
|
- } else {
|
|
|
|
|
|
+ } else if (abort) {
|
|
/*
|
|
/*
|
|
* Still in SYN_RECV, just remove it silently.
|
|
* Still in SYN_RECV, just remove it silently.
|
|
* There is no good way to pass the error to the newly
|
|
* There is no good way to pass the error to the newly
|
|
@@ -383,7 +383,12 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
|
|
}
|
|
}
|
|
seq = ntohl(th->seq);
|
|
seq = ntohl(th->seq);
|
|
if (sk->sk_state == TCP_NEW_SYN_RECV)
|
|
if (sk->sk_state == TCP_NEW_SYN_RECV)
|
|
- return tcp_req_err(sk, seq);
|
|
|
|
|
|
+ return tcp_req_err(sk, seq,
|
|
|
|
+ type == ICMP_PARAMETERPROB ||
|
|
|
|
+ type == ICMP_TIME_EXCEEDED ||
|
|
|
|
+ (type == ICMP_DEST_UNREACH &&
|
|
|
|
+ (code == ICMP_NET_UNREACH ||
|
|
|
|
+ code == ICMP_HOST_UNREACH)));
|
|
|
|
|
|
bh_lock_sock(sk);
|
|
bh_lock_sock(sk);
|
|
/* If too many ICMPs get dropped on busy
|
|
/* If too many ICMPs get dropped on busy
|