--- ./drivers/net/bonding/bond_main.c 2006-02-26 22:49:55.000000000 +0100 +++ ./drivers/net/bonding/bond_main.c 2006-02-27 15:07:39.000000000 +0100 @@ -2366,7 +2366,7 @@ static int bond_ethtool_ioctl(struct net_device *bond_dev, struct ifreq *ifr) { - struct ethtool_drvinfo info; + struct bonding *bond = bond_dev->priv; void *addr = ifr->ifr_data; uint32_t cmd; @@ -2375,7 +2375,8 @@ } switch (cmd) { - case ETHTOOL_GDRVINFO: + case ETHTOOL_GDRVINFO: { + struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; if (copy_from_user(&info, addr, sizeof(info))) { return -EFAULT; } @@ -2410,6 +2411,21 @@ } return 0; + } + case ETHTOOL_GLINK: { + struct slave *curr; + struct ethtool_value etool = {ETHTOOL_GLINK}; + + read_lock(&bond->curr_slave_lock); + curr = bond->curr_active_slave; + read_unlock(&bond->curr_slave_lock); + etool.data = (curr != NULL); + + if (copy_to_user(addr, &etool, sizeof(etool))) { + return -EFAULT; + } + return 0; + } default: return -EOPNOTSUPP; }