|
|
@@ -1206,14 +1206,16 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
|
|
|
v6_cork->tclass = ipc6->tclass;
|
|
|
if (rt->dst.flags & DST_XFRM_TUNNEL)
|
|
|
mtu = np->pmtudisc >= IPV6_PMTUDISC_PROBE ?
|
|
|
- rt->dst.dev->mtu : dst_mtu(&rt->dst);
|
|
|
+ READ_ONCE(rt->dst.dev->mtu) : dst_mtu(&rt->dst);
|
|
|
else
|
|
|
mtu = np->pmtudisc >= IPV6_PMTUDISC_PROBE ?
|
|
|
- rt->dst.dev->mtu : dst_mtu(rt->dst.path);
|
|
|
+ READ_ONCE(rt->dst.dev->mtu) : dst_mtu(rt->dst.path);
|
|
|
if (np->frag_size < mtu) {
|
|
|
if (np->frag_size)
|
|
|
mtu = np->frag_size;
|
|
|
}
|
|
|
+ if (mtu < IPV6_MIN_MTU)
|
|
|
+ return -EINVAL;
|
|
|
cork->base.fragsize = mtu;
|
|
|
if (dst_allfrag(rt->dst.path))
|
|
|
cork->base.flags |= IPCORK_ALLFRAG;
|