diff options
author | Neal Cardwell <ncardwell@google.com> | 2014-08-14 12:40:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-14 17:38:54 -0400 |
commit | 4fab9071950c2021d846e18351e0f46a1cffd67b (patch) | |
tree | f7538ee4e32315a32ab45f3e7bb00e9c6a919bfa /net/ipv4 | |
parent | bc8fc7b8f825ef17a0fb9e68c18ce94fa66ab337 (diff) |
tcp: fix tcp_release_cb() to dispatch via address family for mtu_reduced()
Make sure we use the correct address-family-specific function for
handling MTU reductions from within tcp_release_cb().
Previously AF_INET6 sockets were incorrectly always using the IPv6
code path when sometimes they were handling IPv4 traffic and thus had
an IPv4 dst.
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Willem de Bruijn <willemb@google.com>
Fixes: 563d34d057862 ("tcp: dont drop MTU reduction indications")
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 5 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index dceff5fe8e66..cd17f009aede 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -271,7 +271,7 @@ EXPORT_SYMBOL(tcp_v4_connect); | |||
271 | * It can be called through tcp_release_cb() if socket was owned by user | 271 | * It can be called through tcp_release_cb() if socket was owned by user |
272 | * at the time tcp_v4_err() was called to handle ICMP message. | 272 | * at the time tcp_v4_err() was called to handle ICMP message. |
273 | */ | 273 | */ |
274 | static void tcp_v4_mtu_reduced(struct sock *sk) | 274 | void tcp_v4_mtu_reduced(struct sock *sk) |
275 | { | 275 | { |
276 | struct dst_entry *dst; | 276 | struct dst_entry *dst; |
277 | struct inet_sock *inet = inet_sk(sk); | 277 | struct inet_sock *inet = inet_sk(sk); |
@@ -302,6 +302,7 @@ static void tcp_v4_mtu_reduced(struct sock *sk) | |||
302 | tcp_simple_retransmit(sk); | 302 | tcp_simple_retransmit(sk); |
303 | } /* else let the usual retransmit timer handle it */ | 303 | } /* else let the usual retransmit timer handle it */ |
304 | } | 304 | } |
305 | EXPORT_SYMBOL(tcp_v4_mtu_reduced); | ||
305 | 306 | ||
306 | static void do_redirect(struct sk_buff *skb, struct sock *sk) | 307 | static void do_redirect(struct sk_buff *skb, struct sock *sk) |
307 | { | 308 | { |
@@ -1787,6 +1788,7 @@ const struct inet_connection_sock_af_ops ipv4_specific = { | |||
1787 | .compat_setsockopt = compat_ip_setsockopt, | 1788 | .compat_setsockopt = compat_ip_setsockopt, |
1788 | .compat_getsockopt = compat_ip_getsockopt, | 1789 | .compat_getsockopt = compat_ip_getsockopt, |
1789 | #endif | 1790 | #endif |
1791 | .mtu_reduced = tcp_v4_mtu_reduced, | ||
1790 | }; | 1792 | }; |
1791 | EXPORT_SYMBOL(ipv4_specific); | 1793 | EXPORT_SYMBOL(ipv4_specific); |
1792 | 1794 | ||
@@ -2406,7 +2408,6 @@ struct proto tcp_prot = { | |||
2406 | .sendpage = tcp_sendpage, | 2408 | .sendpage = tcp_sendpage, |
2407 | .backlog_rcv = tcp_v4_do_rcv, | 2409 | .backlog_rcv = tcp_v4_do_rcv, |
2408 | .release_cb = tcp_release_cb, | 2410 | .release_cb = tcp_release_cb, |
2409 | .mtu_reduced = tcp_v4_mtu_reduced, | ||
2410 | .hash = inet_hash, | 2411 | .hash = inet_hash, |
2411 | .unhash = inet_unhash, | 2412 | .unhash = inet_unhash, |
2412 | .get_port = inet_csk_get_port, | 2413 | .get_port = inet_csk_get_port, |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index ff3f0f75cc6c..5a7c41fbc6d3 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -800,7 +800,7 @@ void tcp_release_cb(struct sock *sk) | |||
800 | __sock_put(sk); | 800 | __sock_put(sk); |
801 | } | 801 | } |
802 | if (flags & (1UL << TCP_MTU_REDUCED_DEFERRED)) { | 802 | if (flags & (1UL << TCP_MTU_REDUCED_DEFERRED)) { |
803 | sk->sk_prot->mtu_reduced(sk); | 803 | inet_csk(sk)->icsk_af_ops->mtu_reduced(sk); |
804 | __sock_put(sk); | 804 | __sock_put(sk); |
805 | } | 805 | } |
806 | } | 806 | } |