Improve the SIOCSIFCAP handler a bit:
- allow for ifp->if_ioctl being NULL, as the rest of ifioctl() does; - give the interface driver a chance to report a error to the caller; - don't forget to update ifp->if_lastchange upon successful modification of interface operation parameters.
This commit is contained in:
parent
1b105d0c6e
commit
efb4018be7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126062
@ -1351,9 +1351,13 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
|
||||
error = suser(td);
|
||||
if (error)
|
||||
return (error);
|
||||
if (ifp->if_ioctl == NULL)
|
||||
return (EOPNOTSUPP);
|
||||
if (ifr->ifr_reqcap & ~ifp->if_capabilities)
|
||||
return (EINVAL);
|
||||
(void) (*ifp->if_ioctl)(ifp, cmd, data);
|
||||
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
||||
if (error == 0)
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
break;
|
||||
|
||||
#ifdef MAC
|
||||
|
Loading…
Reference in New Issue
Block a user