vlan: remove MII ioctl forwarding
Subsystems (2)
PATCH v2 1/1 vlan: remove MII ioctl forwarding
VLAN devices forward SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG to the lower device. This exposes the lower device's PHY through the VLAN even when the two devices are in different network namespaces.
Bonding used MII ioctls as a fallback for link monitoring. Commit 23a6037ce76c ("bonding: Remove support for use_carrier") removed that fallback.
Remove vlan_dev_ioctl() and its ndo_eth_ioctl hook so MII ioctls on VLAN devices return -EOPNOTSUPP. Applications that need PHY access can issue these ioctls on the lower device.
---
v2:
- Remove MII ioctl forwarding entirely and target net-next.
v1: https://lore.kernel.org/netdev/[email protected]/
net/8021q/vlan_dev.c | 24 ------------------------ 1 file changed, 24 deletions(-)
net/8021q/vlan_dev.c +0 -24
@@ -406,29 +406,6 @@ static int vlan_hwtstamp_set(struct net_device *dev,return generic_hwtstamp_set_lower (real_dev, cfg, extack); } -static int vlan_dev_ioctl (struct net_device *dev,struct ifreq *ifr,int cmd) -{ -struct net_device *real_dev =vlan_dev_priv (dev)->real_dev; -struct ifreq ifrr; -int err = -EOPNOTSUPP ; - -strscpy_pad (ifrr.ifr_name, real_dev->name,IFNAMSIZ ); - ifrr.ifr_ifru = ifr->ifr_ifru; - -switch (cmd) { -case SIOCGMIIPHY : -case SIOCGMIIREG : -case SIOCSMIIREG : - err =dev_eth_ioctl (real_dev, &ifrr, cmd); -break ; - } - -if (!err) - ifr->ifr_ifru = ifrr.ifr_ifru; - -return err; -} -static int vlan_dev_neigh_setup (struct net_device *dev,struct neigh_parms *pa) {struct net_device *real_dev =vlan_dev_priv (dev)->real_dev;
@@ -1105,7 +1082,6 @@ static const struct net_device_ops vlan_netdev_ops = { .ndo_set_rx_mode = vlan_dev_set_rx_mode, .ndo_change_rx_flags = vlan_dev_change_rx_flags, .ndo_work = vlan_dev_work, - .ndo_eth_ioctl = vlan_dev_ioctl, .ndo_neigh_setup = vlan_dev_neigh_setup, .ndo_get_stats64 = vlan_dev_get_stats64,#if IS_ENABLED (CONFIG_FCOE )
base-commit: d1f4b7c6b997c29de67ad7178ababac2328cb1b4
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Sun, 15 Nov 2026 08:53:43 +0000 you wrote:
VLAN devices forward SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG to the lower device. This exposes the lower device's PHY through the VLAN even when the two devices are in different network namespaces.
Bonding used MII ioctls as a fallback for link monitoring. Commit
23a6037ce76c("bonding: Remove support foruse_carrier") removed that fallback.[...]
Here is the summary with links:
- [net-next,v2] vlan: remove MII ioctl forwarding
https://git.kernel.org/netdev/net-next/c/fbf9026e3503
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html