diff --git a/sys/net/if.c b/sys/net/if.c index 2f289dc09c53..aec6f55ac6f0 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: