freebsd_network: Fix SIOCSIFMTU handling in ether_ioctl.

We cannot set anything below ETHERMIN nor greater than ETHERMTU here,
because we do not know what capabilities the driver actually has.
(The driver will have already caught and handled this ioctl if it
supports something more than the required minimum.)
This commit is contained in:
Augustin Cavalier
2022-05-27 16:37:23 -04:00
parent 41faeb1df9
commit 3ed5041315
+1 -1
View File
@@ -839,7 +839,7 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (command) {
case SIOCSIFMTU:
if (ifr->ifr_mtu > ETHERMTU_JUMBO)
if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU)
return EINVAL;
ifp->if_mtu = ifr->ifr_mtu;
break;