net: pass new SIOCSHWTSTAMP through to device drivers
authorPatrick Ohly <patrick.ohly@intel.com>
Thu, 12 Feb 2009 05:03:40 +0000 (05:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Feb 2009 06:43:38 +0000 (22:43 -0800)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/compat_ioctl.c
net/core/dev.c

index 64f406593c0e69569b234663c5da54c3f97f03e4..763fe69ef3519a01be16cae0c9e6e0bd6af9119a 100644 (file)
@@ -522,6 +522,11 @@ static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
                if (err)
                        return -EFAULT;
                break;
+       case SIOCSHWTSTAMP:
+               if (copy_from_user(&ifr, uifr32, sizeof(*uifr32)))
+                       return -EFAULT;
+               ifr.ifr_data = compat_ptr(uifr32->ifr_ifru.ifru_data);
+               break;
        default:
                if (copy_from_user(&ifr, uifr32, sizeof(*uifr32)))
                        return -EFAULT;
@@ -2563,6 +2568,7 @@ HANDLE_IOCTL(SIOCSIFMAP, dev_ifsioc)
 HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc)
 HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc)
 HANDLE_IOCTL(SIOCSIFHWBROADCAST, dev_ifsioc)
+HANDLE_IOCTL(SIOCSHWTSTAMP, dev_ifsioc)
 
 /* ioctls used by appletalk ddp.c */
 HANDLE_IOCTL(SIOCATALKDIFADDR, dev_ifsioc)
index d20c28e839d378f3243ca63cbf58c7e62958d082..d393fc997cd96683dc0f61b6be11e6b78b06d49b 100644 (file)
@@ -4019,6 +4019,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
                            cmd == SIOCSMIIREG ||
                            cmd == SIOCBRADDIF ||
                            cmd == SIOCBRDELIF ||
+                           cmd == SIOCSHWTSTAMP ||
                            cmd == SIOCWANDEV) {
                                err = -EOPNOTSUPP;
                                if (ops->ndo_do_ioctl) {
@@ -4173,6 +4174,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
                case SIOCBONDCHANGEACTIVE:
                case SIOCBRADDIF:
                case SIOCBRDELIF:
+               case SIOCSHWTSTAMP:
                        if (!capable(CAP_NET_ADMIN))
                                return -EPERM;
                        /* fall through */