net: forbid underlaying devices to change its type
It's not desired for underlaying devices to change type. At the time, there is for example possible to have bond with changed type from Ethernet to Infiniband as a port of a bridge. This patch fixes this. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3ca5b4042e
commit
1c01fe14a8
@@ -82,6 +82,10 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
|
||||
case NETDEV_UNREGISTER:
|
||||
br_del_if(br, dev);
|
||||
break;
|
||||
|
||||
case NETDEV_PRE_TYPE_CHANGE:
|
||||
/* Forbid underlaying device to change its type. */
|
||||
return NOTIFY_BAD;
|
||||
}
|
||||
|
||||
/* Events that may cause spanning tree to refresh */
|
||||
|
||||
Reference in New Issue
Block a user