diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-11-08 23:57:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-08 23:57:03 -0500 |
commit | 7a50a240c495478179f01c9df4bd75e39cff79c7 (patch) | |
tree | 729ac5edbcf93dd4ddc502925b7fe4357a004098 /net | |
parent | fab2532ba50b287647d95046c4f3b37bf6379d37 (diff) |
net/compat_ioctl: support SIOCWANDEV
This adds compat_ioctl support for SIOCWANDEV, which has
always been missing.
The definition of struct compat_ifreq was missing an
ifru_settings fields that is needed to support SIOCWANDEV,
so add that and clean up the whitespace damage in the
struct definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/socket.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c index 224e7f73fdf0..befd9f5b1620 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -2627,6 +2627,27 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32) | |||
2627 | return dev_ioctl(net, SIOCETHTOOL, ifr); | 2627 | return dev_ioctl(net, SIOCETHTOOL, ifr); |
2628 | } | 2628 | } |
2629 | 2629 | ||
2630 | static int compat_siocwandev(struct net *net, struct compat_ifreq __user *uifr32) | ||
2631 | { | ||
2632 | void __user *uptr; | ||
2633 | compat_uptr_t uptr32; | ||
2634 | struct ifreq __user *uifr; | ||
2635 | |||
2636 | uifr = compat_alloc_user_space(sizeof (*uifr)); | ||
2637 | if (copy_in_user(uifr, uifr32, sizeof(struct compat_ifreq))) | ||
2638 | return -EFAULT; | ||
2639 | |||
2640 | if (get_user(uptr32, &uifr32->ifr_settings.ifs_ifsu)) | ||
2641 | return -EFAULT; | ||
2642 | |||
2643 | uptr = compat_ptr(uptr32); | ||
2644 | |||
2645 | if (put_user(uptr, &uifr->ifr_settings.ifs_ifsu.raw_hdlc)) | ||
2646 | return -EFAULT; | ||
2647 | |||
2648 | return dev_ioctl(net, SIOCWANDEV, uifr); | ||
2649 | } | ||
2650 | |||
2630 | static int bond_ioctl(struct net *net, unsigned int cmd, | 2651 | static int bond_ioctl(struct net *net, unsigned int cmd, |
2631 | struct compat_ifreq __user *ifr32) | 2652 | struct compat_ifreq __user *ifr32) |
2632 | { | 2653 | { |
@@ -3058,6 +3079,8 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock, | |||
3058 | return dev_ifconf(net, argp); | 3079 | return dev_ifconf(net, argp); |
3059 | case SIOCETHTOOL: | 3080 | case SIOCETHTOOL: |
3060 | return ethtool_ioctl(net, argp); | 3081 | return ethtool_ioctl(net, argp); |
3082 | case SIOCWANDEV: | ||
3083 | return compat_siocwandev(net, argp); | ||
3061 | case SIOCBONDENSLAVE: | 3084 | case SIOCBONDENSLAVE: |
3062 | case SIOCBONDRELEASE: | 3085 | case SIOCBONDRELEASE: |
3063 | case SIOCBONDSETHWADDR: | 3086 | case SIOCBONDSETHWADDR: |