summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-03-20 13:41:23 +0000
committerjamie <jamie@FreeBSD.org>2009-03-20 13:41:23 +0000
commit422c98f3d60aed59d2e0b965f0b05f617dbb1fab (patch)
tree4f648b84b515707f97bf777d2119caeb40d84b5b /sys/net
parent76ed51bd5ae19d01171f93791177c07f41549e4f (diff)
downloadFreeBSD-src-422c98f3d60aed59d2e0b965f0b05f617dbb1fab.zip
FreeBSD-src-422c98f3d60aed59d2e0b965f0b05f617dbb1fab.tar.gz
Call the interface's if_ioctl from ifioctl(), if the protocol didn't
handle the ioctl. There are other paths that already call it, but this allows for a non-interface socket (like AF_LOCAL which ifconfig now uses) to use a broader class of interface ioctls. Approved by: bz (mentor), rwatson
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 2f289dc..aec6f55 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2025,6 +2025,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)
error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
data,
ifp, td));
+ if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
+ error = (*ifp->if_ioctl)(ifp, cmd, data);
#else
{
int ocmd = cmd;
@@ -2066,6 +2068,9 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)
cmd,
data,
ifp, td));
+ if (error == EOPNOTSUPP && ifp != NULL &&
+ ifp->if_ioctl != NULL)
+ error = (*ifp->if_ioctl)(ifp, cmd, data);
switch (ocmd) {
case OSIOCGIFADDR:
OpenPOWER on IntegriCloud