We currently only support the following upper devices for port netdevs:
1) Bridge
2) LAG (bond / team)
3) VLAN
Any other device is forbidden, so return an error.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
switch (event) {
case NETDEV_PRECHANGEUPPER:
upper_dev = info->upper_dev;
+ if (!is_vlan_dev(upper_dev) &&
+ !netif_is_lag_master(upper_dev) &&
+ !netif_is_bridge_master(upper_dev))
+ return -EINVAL;
if (!info->master || !info->linking)
break;
/* HW limitation forbids to put ports to multiple bridges. */
else
err = mlxsw_sp_port_lag_leave(mlxsw_sp_port,
upper_dev);
+ } else {
+ err = -EINVAL;
+ WARN_ON(1);
}
break;
}