Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37cdb7af authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net/ipv4: always honour route mtu during forwarding"

parents 754a4a97 2ecac8d0
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -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);
}
}