summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-19 15:03:17 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-19 15:45:12 -0700
commitf098846044c9edb359bf2dae4bcf0d537dda22fe (patch)
tree2a372aeddb9943653cdc3f82a7ecadb98f745cb0 /net/ipv6
parentf60fe2df931d6c0b41c3d4f8ec3f7a429f977a3f (diff)
downloadlinux-f098846044c9edb359bf2dae4bcf0d537dda22fe.tar.bz2
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: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index ab7e839753ae..8300176f91e7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -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();