aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/macvlan.c3
-rw-r--r--net/8021q/vlan.c4
-rw-r--r--net/bridge/br_notify.c4
3 files changed, 11 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,
748 list_for_each_entry_safe(vlan, next, &port->vlans, list) 748 list_for_each_entry_safe(vlan, next, &port->vlans, list)
749 vlan->dev->rtnl_link_ops->dellink(vlan->dev, NULL); 749 vlan->dev->rtnl_link_ops->dellink(vlan->dev, NULL);
750 break; 750 break;
751 case NETDEV_PRE_TYPE_CHANGE:
752 /* Forbid underlaying device to change its type. */
753 return NOTIFY_BAD;
751 } 754 }
752 return NOTIFY_DONE; 755 return NOTIFY_DONE;
753} 756}
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 453512266ea1..c39a5f41169c 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -530,6 +530,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
530 } 530 }
531 unregister_netdevice_many(&list); 531 unregister_netdevice_many(&list);
532 break; 532 break;
533
534 case NETDEV_PRE_TYPE_CHANGE:
535 /* Forbid underlaying device to change its type. */
536 return NOTIFY_BAD;
533 } 537 }
534 538
535out: 539out:
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 */