net/netdev/ioctl: correct the argument length of ioctl MII/PHY

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-09-06 21:30:20 +08:00 committed by Xiang Xiao
parent 9726be616a
commit 54dba40f87

View File

@ -1635,6 +1635,18 @@ ssize_t net_ioctl_arglen(int cmd)
case SIOCGIFCOUNT:
case SIOCSIFFLAGS:
case SIOCGIFFLAGS:
case SIOCMIINOTIFY:
case SIOCGMIIPHY:
case SIOCGMIIREG:
case SIOCSMIIREG:
case SIOCGCANBITRATE:
case SIOCSCANBITRATE:
case SIOCACANEXTFILTER:
case SIOCDCANEXTFILTER:
case SIOCACANSTDFILTER:
case SIOCDCANSTDFILTER:
case SIOCGIFNAME:
case SIOCGIFINDEX:
return sizeof(struct ifreq);
case SIOCGLIFADDR:
@ -1668,14 +1680,6 @@ ssize_t net_ioctl_arglen(int cmd)
case SIOCDELRT:
return sizeof(struct rtentry);
case SIOCMIINOTIFY:
return sizeof(struct mii_ioctl_notify_s);
case SIOCGMIIPHY:
case SIOCGMIIREG:
case SIOCSMIIREG:
return sizeof(struct mii_ioctl_data_s);
default:
#ifdef CONFIG_NETDEV_IOCTL
# ifdef CONFIG_NETDEV_WIRELESS_IOCTL