summaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:13:37 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:13:37 -0800
commit1c3cefa582a6b598d204bad02676df300e457efa (patch)
treec56196ce6e35589c43b227887932a5caf1bbe576 /net/core/dev.c
parent991b3ae8019276269816512425f102c4687f2291 (diff)
v2.4.9.4 -> v2.4.9.5
- Merge with Alan - Trond Myklebust: NFS fixes - kmap and root inode special case - Al Viro: more superblock cleanups, inode leak in rd.c, minix directories in page cache - Paul Mackerras: clean up rubbish from sl82c105.c - Neil Brown: md/raid cleanups, NFS filehandles - Johannes Erdfelt: USB update (usb-2.0 support, visor fix, Clie fix, pl2303 driver update) - David Miller: sparc and net update - Eric Biederman: simplify and correct bootdata allocation - don't overwrite ramdisks - Tim Waugh: support multiple SuperIO devices, parport doc updates
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 89d1a0d5d797..6d87f2182136 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2279,6 +2279,32 @@ int dev_ioctl(unsigned int cmd, void *arg)
* These ioctl calls:
* - require superuser power.
* - require strict serialization.
+ * - return a value
+ */
+
+ case SIOCETHTOOL:
+ case SIOCGMIIPHY:
+ case SIOCGMIIREG:
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+ dev_load(ifr.ifr_name);
+ dev_probe_lock();
+ rtnl_lock();
+ ret = dev_ifsioc(&ifr, cmd);
+ rtnl_unlock();
+ dev_probe_unlock();
+ if (!ret) {
+ if (colon)
+ *colon = ':';
+ if (copy_to_user(arg, &ifr, sizeof(struct ifreq)))
+ return -EFAULT;
+ }
+ return ret;
+
+ /*
+ * These ioctl calls:
+ * - require superuser power.
+ * - require strict serialization.
* - do not return a value
*/
@@ -2293,9 +2319,6 @@ int dev_ioctl(unsigned int cmd, void *arg)
case SIOCSIFHWBROADCAST:
case SIOCSIFTXQLEN:
case SIOCSIFNAME:
- case SIOCETHTOOL:
- case SIOCGMIIPHY:
- case SIOCGMIIREG:
case SIOCSMIIREG:
if (!capable(CAP_NET_ADMIN))
return -EPERM;