summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-07-03 07:47:24 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-07-03 07:47:24 +0000
commitdd8ac41eca0b4a7adeda99d04e084105f38f7497 (patch)
treeae37b5c525ad2eeb409e1cce34bb2383ff5dac27 /sys/dev
parenteb94b180fbeb8aa929dcf908affad879a313bf56 (diff)
fix MTU ioctl case
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_bce.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c
index 5e8a28fb02e..168db2d9ef4 100644
--- a/sys/dev/pci/if_bce.c
+++ b/sys/dev/pci/if_bce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bce.c,v 1.7 2005/07/02 23:10:11 brad Exp $ */
+/* $OpenBSD: if_bce.c,v 1.8 2005/07/03 07:47:23 brad Exp $ */
/* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */
/*
@@ -483,6 +483,7 @@ bce_ioctl(ifp, cmd, data)
switch (cmd) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
+
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
@@ -496,7 +497,10 @@ bce_ioctl(ifp, cmd, data)
}
break;
case SIOCSIFMTU:
- ifp->if_mtu = ifr->ifr_mtu;
+ if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU)
+ error = EINVAL;
+ else if (ifp->if_mtu != ifr->ifr_mtu)
+ ifp->if_mtu = ifr->ifr_mtu;
break;
case SIOCSIFFLAGS:
if(ifp->if_flags & IFF_UP)