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

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, error = ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
data, data,
ifp, td)); ifp, td));
if (error == EOPNOTSUPP && ifp != NULL && ifp->if_ioctl != NULL)
error = (*ifp->if_ioctl)(ifp, cmd, data);
#else #else
{ {
int ocmd = cmd; int ocmd = cmd;
@ -2066,6 +2068,9 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)
cmd, cmd,
data, data,
ifp, td)); ifp, td));
if (error == EOPNOTSUPP && ifp != NULL &&
ifp->if_ioctl != NULL)
error = (*ifp->if_ioctl)(ifp, cmd, data);
switch (ocmd) { switch (ocmd) {
case OSIOCGIFADDR: case OSIOCGIFADDR: