summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-02-08 22:09:21 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-02-08 22:09:21 +0000
commit61d5853f15713f19ea6098b9edd088a2001c2024 (patch)
tree57b4340dbe0a74e07066581c056f6765d0a741f9
parentacc62ba83b80cf3478f2d506d7a4f929633c3840 (diff)
fix MTU check.
From damien@
-rw-r--r--sys/dev/pci/if_bge.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 0c933218e0e..f8466dd6ff7 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.128 2006/02/06 04:59:30 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.129 2006/02/08 22:09:20 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -3152,7 +3152,9 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
case SIOCSIFMTU:
if (ifr->ifr_mtu < ETHERMIN ||
((BGE_IS_JUMBO_CAPABLE(sc)) &&
- ifr->ifr_mtu > ETHERMTU_JUMBO) || ifr->ifr_mtu > ETHERMTU)
+ ifr->ifr_mtu > ETHERMTU_JUMBO) ||
+ ((!BGE_IS_JUMBO_CAPABLE(sc)) &&
+ ifr->ifr_mtu > ETHERMTU))
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu)
ifp->if_mtu = ifr->ifr_mtu;