Loading include/net/ip.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -451,12 +451,18 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst, bool forwarding) bool forwarding) { { struct net *net = dev_net(dst->dev); struct net *net = dev_net(dst->dev); unsigned int mtu; if (net->ipv4.sysctl_ip_fwd_use_pmtu || if (net->ipv4.sysctl_ip_fwd_use_pmtu || ip_mtu_locked(dst) || ip_mtu_locked(dst) || !forwarding) !forwarding) return dst_mtu(dst); 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); return min(READ_ONCE(dst->dev->mtu), IP_MAX_MTU); } } Loading Loading
include/net/ip.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -451,12 +451,18 @@ static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst, bool forwarding) bool forwarding) { { struct net *net = dev_net(dst->dev); struct net *net = dev_net(dst->dev); unsigned int mtu; if (net->ipv4.sysctl_ip_fwd_use_pmtu || if (net->ipv4.sysctl_ip_fwd_use_pmtu || ip_mtu_locked(dst) || ip_mtu_locked(dst) || !forwarding) !forwarding) return dst_mtu(dst); 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); return min(READ_ONCE(dst->dev->mtu), IP_MAX_MTU); } } Loading