aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-03-10 05:30:19 -0500
committerDavid S. Miller <davem@davemloft.net>2010-03-18 23:00:02 -0400
commit1c01fe14a87332cc88266fbd6e598319322eb96f (patch)
treee80491a8120724db96f7f6c6d2e2334d33383e6c /net/bridge
parent3ca5b4042ecae5e73c59de62e4ac0db31c10e0f8 (diff)
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 'net/bridge')
-rw-r--r--net/bridge/br_notify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 763a3ec292e5..1413b72acc7f 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -82,6 +82,10 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
82 case NETDEV_UNREGISTER: 82 case NETDEV_UNREGISTER:
83 br_del_if(br, dev); 83 br_del_if(br, dev);
84 break; 84 break;
85
86 case NETDEV_PRE_TYPE_CHANGE:
87 /* Forbid underlaying device to change its type. */
88 return NOTIFY_BAD;
85 } 89 }
86 90
87 /* Events that may cause spanning tree to refresh */ 91 /* Events that may cause spanning tree to refresh */