diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-11-20 00:52:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 01:42:41 -0500 |
commit | 5bc3eb7e2f0026f246d939851109df99e8e9f64a (patch) | |
tree | 6da63169e066a07db21cc5268ac97ceb4c366c1c /net/ipv6 | |
parent | 54a30c975b6b27c0c9268461b647576b146d39bb (diff) |
ip: convert to net_device_ops for ioctl
Convert to net_device_ops function table pointer for ioctl.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 0e41f1be6dc9..e92ad8455c63 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2031,8 +2031,8 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) | |||
2031 | 2031 | ||
2032 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) | 2032 | #if defined(CONFIG_IPV6_SIT) || defined(CONFIG_IPV6_SIT_MODULE) |
2033 | if (dev->type == ARPHRD_SIT) { | 2033 | if (dev->type == ARPHRD_SIT) { |
2034 | const struct net_device_ops *ops = dev->netdev_ops; | ||
2034 | struct ifreq ifr; | 2035 | struct ifreq ifr; |
2035 | mm_segment_t oldfs; | ||
2036 | struct ip_tunnel_parm p; | 2036 | struct ip_tunnel_parm p; |
2037 | 2037 | ||
2038 | err = -EADDRNOTAVAIL; | 2038 | err = -EADDRNOTAVAIL; |
@@ -2048,9 +2048,14 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg) | |||
2048 | p.iph.ttl = 64; | 2048 | p.iph.ttl = 64; |
2049 | ifr.ifr_ifru.ifru_data = (__force void __user *)&p; | 2049 | ifr.ifr_ifru.ifru_data = (__force void __user *)&p; |
2050 | 2050 | ||
2051 | oldfs = get_fs(); set_fs(KERNEL_DS); | 2051 | if (ops->ndo_do_ioctl) { |
2052 | err = dev->do_ioctl(dev, &ifr, SIOCADDTUNNEL); | 2052 | mm_segment_t oldfs = get_fs(); |
2053 | set_fs(oldfs); | 2053 | |
2054 | set_fs(KERNEL_DS); | ||
2055 | err = ops->ndo_do_ioctl(dev, &ifr, SIOCADDTUNNEL); | ||
2056 | set_fs(oldfs); | ||
2057 | } else | ||
2058 | err = -EOPNOTSUPP; | ||
2054 | 2059 | ||
2055 | if (err == 0) { | 2060 | if (err == 0) { |
2056 | err = -ENOBUFS; | 2061 | err = -ENOBUFS; |