diff mbox

[net-next-2.6,3/3] bridge: forbid slave devices to change it's type

Message ID 20100309141947.GE2783@psychotron.lab.eng.brq.redhat.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko March 9, 2010, 2:19 p.m. UTC
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>
---
 net/bridge/br_notify.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 763a3ec..a68c692 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -82,6 +82,9 @@  static int br_device_event(struct notifier_block *unused, unsigned long event, v
 	case NETDEV_UNREGISTER:
 		br_del_if(br, dev);
 		break;
+
+	case NETDEV_TYPE_CHNG_START:
+		return NOTIFY_BAD;
 	}
 
 	/* Events that may cause spanning tree to refresh */