From dd8ac41eca0b4a7adeda99d04e084105f38f7497 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 3 Jul 2005 07:47:24 +0000 Subject: fix MTU ioctl case --- sys/dev/pci/if_bce.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/dev/pci/if_bce.c') 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) -- cgit v1.2.3