mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Merge "net/ipv4: always honour route mtu during forwarding"
This commit is contained in:
commit
37cdb7af00
1 changed files with 6 additions and 0 deletions
|
|
@ -451,12 +451,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue