1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-27 08:00:11 +00:00

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
This commit is contained in:
Jamie Gritton 2009-03-20 13:41:23 +00:00
parent 545dff6fd1
commit bc3977f122
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190151

View File

@ -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: