diff options
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/net/route.h b/include/net/route.h index dd4ae0029fd8..f68c167280a7 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -313,12 +313,20 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | |||
313 | return hoplimit; | 313 | return hoplimit; |
314 | } | 314 | } |
315 | 315 | ||
316 | static inline int ip_skb_dst_mtu(struct sk_buff *skb) | 316 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) |
317 | { | 317 | { |
318 | struct inet_sock *inet = skb->sk ? inet_sk(skb->sk) : NULL; | 318 | return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE; |
319 | } | ||
319 | 320 | ||
320 | return (inet && inet->pmtudisc == IP_PMTUDISC_PROBE) ? | 321 | static inline bool ip_sk_use_pmtu(const struct sock *sk) |
321 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 322 | { |
323 | return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; | ||
324 | } | ||
325 | |||
326 | static inline int ip_skb_dst_mtu(const struct sk_buff *skb) | ||
327 | { | ||
328 | return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ? | ||
329 | dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu; | ||
322 | } | 330 | } |
323 | 331 | ||
324 | #endif /* _ROUTE_H */ | 332 | #endif /* _ROUTE_H */ |