summaryrefslogtreecommitdiff
path: root/sys/net/if_trunk.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-01-10 09:52:05 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-01-10 09:52:05 +0000
commitbe5ceccfa10c09496a4cf5cdcfb29ca97f40cb94 (patch)
tree3d6a96f182f2eaf4e1115147624fb830632bcb7d /sys/net/if_trunk.c
parent4d72d28f8d3b2305c4f1b881d8763beb55ab3107 (diff)
return with ENOTTY instead of EINVAL for unknown ioctl requests to trunk
ports. ok reyk@ dlg@
Diffstat (limited to 'sys/net/if_trunk.c')
-rw-r--r--sys/net/if_trunk.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c
index 0e765c98ca6..a30f2dc1ad9 100644
--- a/sys/net/if_trunk.c
+++ b/sys/net/if_trunk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_trunk.c,v 1.40 2007/11/26 09:28:33 martynas Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.41 2008/01/10 09:52:04 brad Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -497,8 +497,10 @@ trunk_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* Should be checked by the caller */
if (ifp->if_type != IFT_IEEE8023ADLAG ||
(tp = (struct trunk_port *)ifp->if_tp) == NULL ||
- (tr = (struct trunk_softc *)tp->tp_trunk) == NULL)
+ (tr = (struct trunk_softc *)tp->tp_trunk) == NULL) {
+ error = EINVAL;
goto fallback;
+ }
switch (cmd) {
case SIOCGTRUNKPORT:
@@ -518,6 +520,7 @@ trunk_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
trunk_port2req(tp, rp);
break;
default:
+ error = ENOTTY;
goto fallback;
}
@@ -528,9 +531,9 @@ trunk_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
splx(s);
if (tp != NULL)
- return ((*tp->tp_ioctl)(ifp, cmd, data));
+ error = (*tp->tp_ioctl)(ifp, cmd, data);
- return (EINVAL);
+ return (error);
}
void