summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorprovos <provos@openbsd.org>2000-09-17 19:10:55 +0000
committerprovos <provos@openbsd.org>2000-09-17 19:10:55 +0000
commit076ff3b6515732f70c86b7f1d344652f59a02d6e (patch)
treec30062b6d927859e43c4404334e65966b632e950 /sys
parentAdd fxp cardbus attachment here, too. Shorten some attachment descriptions. (diff)
downloadwireguard-openbsd-076ff3b6515732f70c86b7f1d344652f59a02d6e.tar.xz
wireguard-openbsd-076ff3b6515732f70c86b7f1d344652f59a02d6e.zip
implement SIOCSIFMTU, okay deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/elink3.c11
-rw-r--r--sys/dev/pcmcia/if_wi.c12
2 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c
index 18211c722e6..1ee235808fa 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elink3.c,v 1.43 2000/09/17 00:06:01 aaron Exp $ */
+/* $OpenBSD: elink3.c,v 1.44 2000/09/17 19:10:56 provos Exp $ */
/* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */
/*
@@ -1525,6 +1525,15 @@ epioctl(ifp, cmd, data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
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;
+ }
+ break;
+
+
case SIOCSIFFLAGS:
if ((ifp->if_flags & IFF_UP) == 0 &&
(ifp->if_flags & IFF_RUNNING) != 0) {
diff --git a/sys/dev/pcmcia/if_wi.c b/sys/dev/pcmcia/if_wi.c
index b0fc4f31877..4f6dd0cc6ae 100644
--- a/sys/dev/pcmcia/if_wi.c
+++ b/sys/dev/pcmcia/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.15 2000/06/30 01:04:28 art Exp $ */
+/* $OpenBSD: if_wi.c,v 1.16 2000/09/17 19:10:55 provos Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -133,7 +133,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.15 2000/06/30 01:04:28 art Exp $";
+ "$OpenBSD: if_wi.c,v 1.16 2000/09/17 19:10:55 provos Exp $";
#endif /* lint */
#ifdef foo
@@ -1082,6 +1082,14 @@ wi_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;
+ }
+ break;
+
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING &&