diff options
author | David S. Miller <[email protected]> | 2023-11-16 23:35:12 +0000 |
---|---|---|
committer | David S. Miller <[email protected]> | 2023-11-16 23:35:12 +0000 |
commit | 9a1f02f3ef96bd83162e94e4ee34a4f8240256ba (patch) | |
tree | c173673d5fb2dc3dd62efba9e2cc6d4fc5b015a9 /net/ipv6/tcp_ipv6.c | |
parent | c6e9dba3be5ef3b701b29b143609561915e5d0e9 (diff) | |
parent | 0a8de364ff7a14558e9676f424283148110384d6 (diff) |
Merge branch 'tcp-change-reaction-to-ICMP'
Eric Dumazet says:
====================
tcp: change reaction to ICMP messages
ICMP[v6] messages received for a socket in TCP_SYN_SENT currently abort
the connection attempt, in violation of standards.
This series changes our stack to adhere to RFC 6069 and RFC 1122
(4.2.3.9)
====================
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 937a02c2e534..43deda49cc52 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -381,7 +381,7 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, struct tcp_sock *tp; __u32 seq, snd_una; struct sock *sk; - bool fatal; + bool harderr; int err; sk = __inet6_lookup_established(net, net->ipv4.tcp_death_row.hashinfo, @@ -402,9 +402,9 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, return 0; } seq = ntohl(th->seq); - fatal = icmpv6_err_convert(type, code, &err); + harderr = icmpv6_err_convert(type, code, &err); if (sk->sk_state == TCP_NEW_SYN_RECV) { - tcp_req_err(sk, seq, fatal); + tcp_req_err(sk, seq, harderr); return 0; } @@ -489,6 +489,9 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ipv6_icmp_error(sk, skb, err, th->dest, ntohl(info), (u8 *)th); + if (!harderr) + break; + if (!sock_owned_by_user(sk)) { WRITE_ONCE(sk->sk_err, err); sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */ |