From 54dba40f879e1104fbaff3ce3aef285c27ce5cc1 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 6 Sep 2022 21:30:20 +0800 Subject: [PATCH] net/netdev/ioctl: correct the argument length of ioctl MII/PHY Signed-off-by: chao an --- net/netdev/netdev_ioctl.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 39b7e02cb7..12867726ba 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -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