aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-10-05 17:33:26 -0700
committerDavid S. Miller <davem@davemloft.net>2020-10-05 18:40:01 -0700
commit8b0308fe319b8002753ea66f8f940fb393792ddd (patch)
tree4c5a80346308db8cac9ff0951bb10e892c2387ad /include/net/ip.h
parentnet: phy: marvell: Use phy_read_paged() instead of open coding it (diff)
parentMerge tag 'platform-drivers-x86-v5.9-2' of git://git.infradead.org/linux-platform-drivers-x86 (diff)
downloadlinux-dev-8b0308fe319b8002753ea66f8f940fb393792ddd.tar.xz
linux-dev-8b0308fe319b8002753ea66f8f940fb393792ddd.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Rejecting non-native endian BTF overlapped with the addition of support for it. The rest were more simple overlapping changes, except the renesas ravb binding update, which had to follow a file move as well as a YAML conversion. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 0f72bf8c0cbf..2d6b985d11cc 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -436,12 +436,18 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
bool forwarding)
{
struct net *net = dev_net(dst->dev);
+ unsigned int mtu;
if (net->ipv4.sysctl_ip_fwd_use_pmtu ||
ip_mtu_locked(dst) ||
!forwarding)
return dst_mtu(dst);
+ /* 'forwarding = true' case should always honour route mtu */
+ mtu = dst_metric_raw(dst, RTAX_MTU);
+ if (mtu)
+ return mtu;
+
return min(READ_ONCE(dst->dev->mtu), IP_MAX_MTU);
}