summaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-10-05 06:08:08 +0200
committerDavid S. Miller <davem@davemloft.net>2015-10-05 11:45:24 +0200
commitcaf3f2676aaad395903d24a54e22f8ac4bc4823d (patch)
tree2892221a8b1f40f57e8c8bac5a6e453991e34a61 /include/net/ip.h
parenttcp: fix fastopen races vs lockless listener (diff)
downloadlinux-caf3f2676aaad395903d24a54e22f8ac4bc4823d.tar.xz
linux-caf3f2676aaad395903d24a54e22f8ac4bc4823d.zip
inet: ip_skb_dst_mtu() should use sk_fullsock()
SYN_RECV & TIMEWAIT sockets are not full blown, do not even try to call ip_sk_use_pmtu() on them. Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--include/net/ip.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 91a6b2c88341..aa7811993276 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -323,12 +323,15 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
{
- if (!skb->sk || ip_sk_use_pmtu(skb->sk)) {
+ struct sock *sk = skb->sk;
+
+ if (!sk || !sk_fullsock(sk) || ip_sk_use_pmtu(sk)) {
bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED;
+
return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
- } else {
- return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
}
+
+ return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
}
u32 ip_idents_reserve(u32 hash, int segs);