diff options
author | yar <yar@FreeBSD.org> | 2004-02-21 12:48:25 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-02-21 12:48:25 +0000 |
commit | 3325da8ccdc7f58de4150a0632cfb3907766a3f9 (patch) | |
tree | c6c3f60dbf8d400a3d922b803f944d834c26fa3c /sys | |
parent | 80fe0dbbdf558ad69469660d5f3ecbb39f86da67 (diff) | |
download | FreeBSD-src-3325da8ccdc7f58de4150a0632cfb3907766a3f9.zip FreeBSD-src-3325da8ccdc7f58de4150a0632cfb3907766a3f9.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index edec90f..afec9f9 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -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 |