diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2009-02-12 00:03:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 01:43:38 -0500 |
commit | d24fff22d8dba13cc21034144f68f213415cb7c8 (patch) | |
tree | 9f199f1d122bb58e78c0dcf7078915b89b8660c0 | |
parent | 51f31cabe3ce5345b51e4a4f82138b38c4d5dc91 (diff) |
net: pass new SIOCSHWTSTAMP through to device drivers
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | fs/compat_ioctl.c | 6 | ||||
-rw-r--r-- | net/core/dev.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 64f406593c0e..763fe69ef351 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -522,6 +522,11 @@ static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg) | |||
522 | if (err) | 522 | if (err) |
523 | return -EFAULT; | 523 | return -EFAULT; |
524 | break; | 524 | break; |
525 | case SIOCSHWTSTAMP: | ||
526 | if (copy_from_user(&ifr, uifr32, sizeof(*uifr32))) | ||
527 | return -EFAULT; | ||
528 | ifr.ifr_data = compat_ptr(uifr32->ifr_ifru.ifru_data); | ||
529 | break; | ||
525 | default: | 530 | default: |
526 | if (copy_from_user(&ifr, uifr32, sizeof(*uifr32))) | 531 | if (copy_from_user(&ifr, uifr32, sizeof(*uifr32))) |
527 | return -EFAULT; | 532 | return -EFAULT; |
@@ -2563,6 +2568,7 @@ HANDLE_IOCTL(SIOCSIFMAP, dev_ifsioc) | |||
2563 | HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc) | 2568 | HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc) |
2564 | HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc) | 2569 | HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc) |
2565 | HANDLE_IOCTL(SIOCSIFHWBROADCAST, dev_ifsioc) | 2570 | HANDLE_IOCTL(SIOCSIFHWBROADCAST, dev_ifsioc) |
2571 | HANDLE_IOCTL(SIOCSHWTSTAMP, dev_ifsioc) | ||
2566 | 2572 | ||
2567 | /* ioctls used by appletalk ddp.c */ | 2573 | /* ioctls used by appletalk ddp.c */ |
2568 | HANDLE_IOCTL(SIOCATALKDIFADDR, dev_ifsioc) | 2574 | HANDLE_IOCTL(SIOCATALKDIFADDR, dev_ifsioc) |
diff --git a/net/core/dev.c b/net/core/dev.c index d20c28e839d3..d393fc997cd9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4019,6 +4019,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) | |||
4019 | cmd == SIOCSMIIREG || | 4019 | cmd == SIOCSMIIREG || |
4020 | cmd == SIOCBRADDIF || | 4020 | cmd == SIOCBRADDIF || |
4021 | cmd == SIOCBRDELIF || | 4021 | cmd == SIOCBRDELIF || |
4022 | cmd == SIOCSHWTSTAMP || | ||
4022 | cmd == SIOCWANDEV) { | 4023 | cmd == SIOCWANDEV) { |
4023 | err = -EOPNOTSUPP; | 4024 | err = -EOPNOTSUPP; |
4024 | if (ops->ndo_do_ioctl) { | 4025 | if (ops->ndo_do_ioctl) { |
@@ -4173,6 +4174,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
4173 | case SIOCBONDCHANGEACTIVE: | 4174 | case SIOCBONDCHANGEACTIVE: |
4174 | case SIOCBRADDIF: | 4175 | case SIOCBRADDIF: |
4175 | case SIOCBRDELIF: | 4176 | case SIOCBRDELIF: |
4177 | case SIOCSHWTSTAMP: | ||
4176 | if (!capable(CAP_NET_ADMIN)) | 4178 | if (!capable(CAP_NET_ADMIN)) |
4177 | return -EPERM; | 4179 | return -EPERM; |
4178 | /* fall through */ | 4180 | /* fall through */ |