diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-03-10 13:30:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-19 06:00:02 +0300 |
commit | 1c01fe14a87332cc88266fbd6e598319322eb96f (patch) | |
tree | e80491a8120724db96f7f6c6d2e2334d33383e6c /drivers/net/macvlan.c | |
parent | 3ca5b4042ecae5e73c59de62e4ac0db31c10e0f8 (diff) | |
download | linux-1c01fe14a87332cc88266fbd6e598319322eb96f.tar.xz |
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>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 40faa368b07a..445e73c343ba 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -748,6 +748,9 @@ static int macvlan_device_event(struct notifier_block *unused, list_for_each_entry_safe(vlan, next, &port->vlans, list) vlan->dev->rtnl_link_ops->dellink(vlan->dev, NULL); break; + case NETDEV_PRE_TYPE_CHANGE: + /* Forbid underlaying device to change its type. */ + return NOTIFY_BAD; } return NOTIFY_DONE; } |