Back out redundant check, and remove the MAXMTU comparison as it's
outside of the (bogus) tuninfo mtu range. Pointed out by: bde
This commit is contained in:
parent
5abb82ea11
commit
a18e16060e
|
@ -302,12 +302,9 @@ tunifioctl(ifp, cmd, data)
|
||||||
ifp->if_name, ifp->if_unit);
|
ifp->if_name, ifp->if_unit);
|
||||||
break;
|
break;
|
||||||
case SIOCSIFMTU:
|
case SIOCSIFMTU:
|
||||||
if (ifr->ifr_mtu < IF_MINMTU || ifr->ifr_mtu > IF_MAXMTU)
|
ifp->if_mtu = ifr->ifr_mtu;
|
||||||
error = EINVAL;
|
TUNDEBUG("%s%d: mtu set\n",
|
||||||
else {
|
ifp->if_name, ifp->if_unit);
|
||||||
ifp->if_mtu = ifr->ifr_mtu;
|
|
||||||
TUNDEBUG("%s%d: mtu set\n", ifp->if_name, ifp->if_unit);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case SIOCADDMULTI:
|
case SIOCADDMULTI:
|
||||||
case SIOCDELMULTI:
|
case SIOCDELMULTI:
|
||||||
|
@ -438,7 +435,7 @@ tunioctl(dev, cmd, data, flag, p)
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case TUNSIFINFO:
|
case TUNSIFINFO:
|
||||||
tunp = (struct tuninfo *)data;
|
tunp = (struct tuninfo *)data;
|
||||||
if (tunp->mtu < IF_MINMTU || tunp->mtu > IF_MAXMTU)
|
if (tunp->mtu < IF_MINMTU)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
tp->tun_if.if_mtu = tunp->mtu;
|
tp->tun_if.if_mtu = tunp->mtu;
|
||||||
tp->tun_if.if_type = tunp->type;
|
tp->tun_if.if_type = tunp->type;
|
||||||
|
|
Loading…
Reference in New Issue