Commit d2924569 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: ipv6: support RFC 6069 (TCP-LD)

Make tcp_ld_RTO_revert() helper available to IPv6, and
implement RFC 6069 :

Quoting this RFC :

3. Connectivity Disruption Indication

   For Internet Protocol version 6 (IPv6) [RFC2460], the counterpart of
   the ICMP destination unreachable message of code 0 (net unreachable)
   and of code 1 (host unreachable) is the ICMPv6 destination
   unreachable message of code 0 (no route to destination) [RFC4443].
   As with IPv4, a router should generate an ICMPv6 destination
   unreachable message of code 0 in response to a packet that cannot be
   delivered to its destination address because it lacks a matching
   entry in its routing table.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarYuchung Cheng <ycheng@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d752508
...@@ -437,6 +437,7 @@ u16 tcp_get_syncookie_mss(struct request_sock_ops *rsk_ops, ...@@ -437,6 +437,7 @@ u16 tcp_get_syncookie_mss(struct request_sock_ops *rsk_ops,
void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
void tcp_v4_mtu_reduced(struct sock *sk); void tcp_v4_mtu_reduced(struct sock *sk);
void tcp_req_err(struct sock *sk, u32 seq, bool abort); void tcp_req_err(struct sock *sk, u32 seq, bool abort);
void tcp_ld_RTO_revert(struct sock *sk, u32 seq);
int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
struct sock *tcp_create_openreq_child(const struct sock *sk, struct sock *tcp_create_openreq_child(const struct sock *sk,
struct request_sock *req, struct request_sock *req,
......
...@@ -404,7 +404,7 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort) ...@@ -404,7 +404,7 @@ void tcp_req_err(struct sock *sk, u32 seq, bool abort)
EXPORT_SYMBOL(tcp_req_err); EXPORT_SYMBOL(tcp_req_err);
/* TCP-LD (RFC 6069) logic */ /* TCP-LD (RFC 6069) logic */
static void tcp_ld_RTO_revert(struct sock *sk, u32 seq) void tcp_ld_RTO_revert(struct sock *sk, u32 seq)
{ {
struct inet_connection_sock *icsk = inet_csk(sk); struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
...@@ -441,6 +441,7 @@ static void tcp_ld_RTO_revert(struct sock *sk, u32 seq) ...@@ -441,6 +441,7 @@ static void tcp_ld_RTO_revert(struct sock *sk, u32 seq)
tcp_retransmit_timer(sk); tcp_retransmit_timer(sk);
} }
} }
EXPORT_SYMBOL(tcp_ld_RTO_revert);
/* /*
* This routine is called by the ICMP module when it gets some * This routine is called by the ICMP module when it gets some
......
...@@ -473,6 +473,15 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, ...@@ -473,6 +473,15 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
} else } else
sk->sk_err_soft = err; sk->sk_err_soft = err;
goto out; goto out;
case TCP_LISTEN:
break;
default:
/* check if this ICMP message allows revert of backoff.
* (see RFC 6069)
*/
if (!fastopen && type == ICMPV6_DEST_UNREACH &&
code == ICMPV6_NOROUTE)
tcp_ld_RTO_revert(sk, seq);
} }
if (!sock_owned_by_user(sk) && np->recverr) { if (!sock_owned_by_user(sk) && np->recverr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment