diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2013-11-14 01:19:29 +0000 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-11-19 19:07:21 +0000 |
commit | fd468c74bd4d6949736810a80d6ca05eb20fba84 (patch) | |
tree | c68b11620237ba704b740827ce952409b5666231 /net | |
parent | 590d4693fb1c96ce441d11c6d1acb413a90b62e5 (diff) | |
download | op-kernel-dev-fd468c74bd4d6949736810a80d6ca05eb20fba84.zip op-kernel-dev-fd468c74bd4d6949736810a80d6ca05eb20fba84.tar.gz |
net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP
SIOCSHWTSTAMP returns the real configuration to the application
using it, but there is currently no way for any other
application to find out the configuration non-destructively.
Add a new ioctl for this, making it unprivileged.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev_ioctl.c | 2 | ||||
-rw-r--r-- | net/socket.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 5b7d0e1..cf999e0 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -327,6 +327,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) cmd == SIOCBRADDIF || cmd == SIOCBRDELIF || cmd == SIOCSHWTSTAMP || + cmd == SIOCGHWTSTAMP || cmd == SIOCWANDEV) { err = -EOPNOTSUPP; if (ops->ndo_do_ioctl) { @@ -546,6 +547,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) */ default: if (cmd == SIOCWANDEV || + cmd == SIOCGHWTSTAMP || (cmd >= SIOCDEVPRIVATE && cmd <= SIOCDEVPRIVATE + 15)) { dev_load(net, ifr.ifr_name); diff --git a/net/socket.c b/net/socket.c index 7a766ab..1a548b7 100644 --- a/net/socket.c +++ b/net/socket.c @@ -3231,6 +3231,7 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, case SIOCBONDSLAVEINFOQUERY: case SIOCBONDINFOQUERY: case SIOCSHWTSTAMP: + case SIOCGHWTSTAMP: return compat_ifr_data_ioctl(net, cmd, argp); case FIOSETOWN: |