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:
parent
545dff6fd1
commit
bc3977f122
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user