diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/re/if_re.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 9a05419..93d82b7 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -2640,10 +2640,18 @@ re_ioctl(ifp, command, data) switch (command) { case SIOCSIFMTU: - RL_LOCK(sc); - if (ifr->ifr_mtu > RL_JUMBO_MTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > RL_JUMBO_MTU) { + error = EINVAL; + break; + } + if (sc->rl_type == RL_8139CPLUS && + ifr->ifr_mtu > RL_MAX_FRAMELEN) { error = EINVAL; - ifp->if_mtu = ifr->ifr_mtu; + break; + } + RL_LOCK(sc); + if (ifp->if_mtu != ifr->ifr_mtu) + ifp->if_mtu = ifr->ifr_mtu; RL_UNLOCK(sc); break; case SIOCSIFFLAGS: |