summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2002-01-08 05:38:53 +0000
committerfgsch <fgsch@openbsd.org>2002-01-08 05:38:53 +0000
commit8103694e4db4db93d80578f43379b200042e81e5 (patch)
treeeaf5b88309513f840e09fb2f3637f88adead2638
parentsync (diff)
downloadwireguard-openbsd-8103694e4db4db93d80578f43379b200042e81e5.tar.xz
wireguard-openbsd-8103694e4db4db93d80578f43379b200042e81e5.zip
SIOCSIFMTU support; patches by Claudio Castiglia <ccastig@softhome.net>
-rw-r--r--sys/dev/ic/dp8390.c10
-rw-r--r--sys/dev/ic/rtl81x9.c9
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index 066528277d9..4f369894d55 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390.c,v 1.19 2001/09/20 17:02:31 mpech Exp $ */
+/* $OpenBSD: dp8390.c,v 1.20 2002/01/08 05:38:53 fgsch Exp $ */
/* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */
/*
@@ -849,6 +849,14 @@ dp8390_ioctl(ifp, cmd, 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) == 0 &&
(ifp->if_flags & IFF_RUNNING) != 0) {
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c
index 8fbe3b4496b..265cb6523c4 100644
--- a/sys/dev/ic/rtl81x9.c
+++ b/sys/dev/ic/rtl81x9.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9.c,v 1.11 2001/11/06 19:53:18 miod Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.12 2002/01/08 05:38:53 fgsch Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -1092,6 +1092,13 @@ int rl_ioctl(ifp, command, data)
break;
}
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) {
rl_init(sc);