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

ipv6: stub out even more of addrconf_set_dstaddr if SIT is disabled

There is no point in copying the structure from userspace or looking up
a device if SIT support is not disabled and we'll eventually return
-ENODEV anyway.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f60fe2df
......@@ -2794,6 +2794,9 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
struct net_device *dev;
int err = -EINVAL;
if (!IS_ENABLED(CONFIG_IPV6_SIT))
return -ENODEV;
rtnl_lock();
err = -EFAULT;
......@@ -2806,7 +2809,6 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
if (!dev)
goto err_exit;
#if IS_ENABLED(CONFIG_IPV6_SIT)
if (dev->type == ARPHRD_SIT) {
const struct net_device_ops *ops = dev->netdev_ops;
struct ifreq ifr;
......@@ -2842,7 +2844,6 @@ int addrconf_set_dstaddr(struct net *net, void __user *arg)
err = dev_open(dev, NULL);
}
}
#endif
err_exit:
rtnl_unlock();
......
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