diff options
author | yongari <yongari@FreeBSD.org> | 2008-03-03 03:41:06 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2008-03-03 03:41:06 +0000 |
commit | 936e4f90ebc612dfeed4f71f2b1f322c9af26393 (patch) | |
tree | 4adebcc4b4b593e75eb4309a5c27f1d048733b72 /sys/dev | |
parent | 31e7117ef15ad6fc68674edeb61182605947f9f0 (diff) | |
download | FreeBSD-src-936e4f90ebc612dfeed4f71f2b1f322c9af26393.zip FreeBSD-src-936e4f90ebc612dfeed4f71f2b1f322c9af26393.tar.gz |
Don't allow jumbo frame on 8139C+ controller.
While I'm here add a check for minimal MTU length.
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: |