diff options
Diffstat (limited to 'include/net/ip.h')
-rw-r--r-- | include/net/ip.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index d53b5a9eae34..36f8f7811093 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -337,6 +337,13 @@ int ip_decrease_ttl(struct iphdr *iph) | |||
337 | return --iph->ttl; | 337 | return --iph->ttl; |
338 | } | 338 | } |
339 | 339 | ||
340 | static inline int ip_mtu_locked(const struct dst_entry *dst) | ||
341 | { | ||
342 | const struct rtable *rt = (const struct rtable *)dst; | ||
343 | |||
344 | return rt->rt_mtu_locked || dst_metric_locked(dst, RTAX_MTU); | ||
345 | } | ||
346 | |||
340 | static inline | 347 | static inline |
341 | int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst) | 348 | int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst) |
342 | { | 349 | { |
@@ -344,7 +351,7 @@ int ip_dont_fragment(const struct sock *sk, const struct dst_entry *dst) | |||
344 | 351 | ||
345 | return pmtudisc == IP_PMTUDISC_DO || | 352 | return pmtudisc == IP_PMTUDISC_DO || |
346 | (pmtudisc == IP_PMTUDISC_WANT && | 353 | (pmtudisc == IP_PMTUDISC_WANT && |
347 | !(dst_metric_locked(dst, RTAX_MTU))); | 354 | !ip_mtu_locked(dst)); |
348 | } | 355 | } |
349 | 356 | ||
350 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) | 357 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) |
@@ -370,7 +377,7 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst, | |||
370 | struct net *net = dev_net(dst->dev); | 377 | struct net *net = dev_net(dst->dev); |
371 | 378 | ||
372 | if (net->ipv4.sysctl_ip_fwd_use_pmtu || | 379 | if (net->ipv4.sysctl_ip_fwd_use_pmtu || |
373 | dst_metric_locked(dst, RTAX_MTU) || | 380 | ip_mtu_locked(dst) || |
374 | !forwarding) | 381 | !forwarding) |
375 | return dst_mtu(dst); | 382 | return dst_mtu(dst); |
376 | 383 | ||