net: bonding: move ioctl handling to private ndo operation

All other user triggered operations are gone from ndo_ioctl, so move
the SIOCBOND family into a custom operation as well.

The .ndo_ioctl() helper is no longer called by the dev_ioctl.c code now,
but there are still a few definitions in obsolete wireless drivers as well
as the appletalk and ieee802154 layers to call SIOCSIFADDR/SIOCGIFADDR
helpers from inside the kernel.

Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arnd Bergmann 2021-07-27 15:45:17 +02:00 committed by David S. Miller
parent ad2f99aedf
commit 3d9d00bd18
4 changed files with 26 additions and 8 deletions

View file

@ -260,14 +260,14 @@ static int dev_eth_ioctl(struct net_device *dev,
return err;
}
static int dev_do_ioctl(struct net_device *dev,
static int dev_siocbond(struct net_device *dev,
struct ifreq *ifr, unsigned int cmd)
{
const struct net_device_ops *ops = dev->netdev_ops;
if (ops->ndo_do_ioctl) {
if (ops->ndo_siocbond) {
if (netif_device_present(dev))
return ops->ndo_do_ioctl(dev, ifr, cmd);
return ops->ndo_siocbond(dev, ifr, cmd);
else
return -ENODEV;
}
@ -407,7 +407,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
cmd == SIOCBONDSLAVEINFOQUERY ||
cmd == SIOCBONDINFOQUERY ||
cmd == SIOCBONDCHANGEACTIVE) {
err = dev_do_ioctl(dev, ifr, cmd);
err = dev_siocbond(dev, ifr, cmd);
} else
err = -EINVAL;