@@ -313,14 +313,14 @@ static inline unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst)
struct inet6_dev *idev;
unsigned int mtu = dst_metric_raw(dst, RTAX_MTU);
if (mtu)
- return mtu;
+ return max(mtu, (unsigned)IPV6_MIN_MTU);
rcu_read_lock();
idev = __in6_dev_get(dst->dev);
mtu = idev ? idev->cnf.mtu6 : IPV6_MIN_MTU;
rcu_read_unlock();
- return mtu;
+ return max(mtu, (unsigned)IPV6_MIN_MTU);
}
u32 ip6_mtu_from_fib6(const struct fib6_result *res,
@@ -540,8 +540,6 @@ int ip6_forward(struct sk_buff *skb)
}
mtu = ip6_dst_mtu_forward(dst);
- if (mtu < IPV6_MIN_MTU)
- mtu = IPV6_MIN_MTU;
if (ip6_pkt_too_big(skb, mtu)) {
/* Again, force OUTPUT device used as source address */