summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChris Cappuccio <chris@cvs.openbsd.org>2000-04-27 00:00:26 +0000
committerChris Cappuccio <chris@cvs.openbsd.org>2000-04-27 00:00:26 +0000
commit6efc612ede960677ccc538d52e5ebb06117e09ea (patch)
tree44a226832a2c4c3832acc4e350c40c42f994338f /sys
parent2ff690a15797dceababa2e77f7dca9567657c9b9 (diff)
Fix SIOCSIFMTU
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/fxp.c12
-rw-r--r--sys/net/if_vlan.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 4d19ead4464..c3743059622 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.3 2000/04/26 19:12:08 chris Exp $ */
+/* $OpenBSD: fxp.c,v 1.4 2000/04/27 00:00:25 chris Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -1415,10 +1415,18 @@ fxp_ioctl(ifp, command, data)
case SIOCSIFADDR:
case SIOCGIFADDR:
- case SIOCSIFMTU:
error = ether_ioctl(ifp, command, data);
break;
+ case SIOCSIFMTU:
+ if (ifr->ifr_mtu > ETHERMTU || ifr->ifr_mtu < ETHERMIN) {
+ error = EINVAL;
+ } else if (ifp->if_mtu != ifr->ifr_mtu) {
+ ifp->if_mtu = ifr->ifr_mtu;
+ error = fxp_init(sc);
+ }
+ break;
+
case SIOCSIFFLAGS:
sc->all_mcasts = (ifp->if_flags & IFF_ALLMULTI) ? 1 : 0;
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 2f41736c946..6cd892e2739 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.2 2000/04/26 22:57:27 chris Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.3 2000/04/27 00:00:24 chris Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
*
@@ -503,7 +503,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* jumbo frames. It would be nice to replace ETHERMTU
* with the parent interface's MTU in the following statement.
*/
- if (ifr->ifr_mtu > ETHERMTU) {
+ if (ifr->ifr_mtu > ETHERMTU || ifr->ifr_mtu < ETHERMIN) {
error = EINVAL;
} else {
ifp->if_mtu = ifr->ifr_mtu;