Commit 8e3db0bb authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

ipv6: use ->ndo_tunnel_ctl in addrconf_set_dstaddr

Use the new ->ndo_tunnel_ctl instead of overriding the address limit
and using ->ndo_do_ioctl just to do a pointless user copy.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68ad6886
...@@ -2787,8 +2787,6 @@ static int addrconf_set_sit_dstaddr(struct net *net, struct net_device *dev, ...@@ -2787,8 +2787,6 @@ static int addrconf_set_sit_dstaddr(struct net *net, struct net_device *dev,
struct in6_ifreq *ireq) struct in6_ifreq *ireq)
{ {
struct ip_tunnel_parm p = { }; struct ip_tunnel_parm p = { };
mm_segment_t oldfs = get_fs();
struct ifreq ifr;
int err; int err;
if (!(ipv6_addr_type(&ireq->ifr6_addr) & IPV6_ADDR_COMPATv4)) if (!(ipv6_addr_type(&ireq->ifr6_addr) & IPV6_ADDR_COMPATv4))
...@@ -2799,13 +2797,10 @@ static int addrconf_set_sit_dstaddr(struct net *net, struct net_device *dev, ...@@ -2799,13 +2797,10 @@ static int addrconf_set_sit_dstaddr(struct net *net, struct net_device *dev,
p.iph.ihl = 5; p.iph.ihl = 5;
p.iph.protocol = IPPROTO_IPV6; p.iph.protocol = IPPROTO_IPV6;
p.iph.ttl = 64; p.iph.ttl = 64;
ifr.ifr_ifru.ifru_data = (__force void __user *)&p;
if (!dev->netdev_ops->ndo_do_ioctl) if (!dev->netdev_ops->ndo_tunnel_ctl)
return -EOPNOTSUPP; return -EOPNOTSUPP;
set_fs(KERNEL_DS); err = dev->netdev_ops->ndo_tunnel_ctl(dev, &p, SIOCADDTUNNEL);
err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCADDTUNNEL);
set_fs(oldfs);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment