netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] vlan: only create special VLAN 0 once
@ 2011-06-03 20:07 Jiri Bohac
  2011-06-03 20:14 ` [PATCH 2/2] bonding: restore NETIF_F_VLAN_CHALLENGED properly in bond_del_vlan() Jiri Bohac
  2011-06-05 21:28 ` [PATCH 1/2] vlan: only create special VLAN 0 once David Miller
  0 siblings, 2 replies; 13+ messages in thread
From: Jiri Bohac @ 2011-06-03 20:07 UTC (permalink / raw)
  To: Patrick McHardy, David S. Miller, netdev; +Cc: Pedro Garcia

Commit ad1afb00 registers a VLAN with vid == 0 for every device to handle
802.1p frames.  This is currently done on every NETDEV_UP event and the special
vlan is never unregistered.  This may have strange effects on drivers
implementning ndo_vlan_rx_add_vid(). E.g. bonding will allocate a linked-list
element each time, causing a memory leak.

Only register the special VLAN once on NETDEV_REGISTER.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index c7a581a..bf89565 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -371,7 +371,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 	if (is_vlan_dev(dev))
 		__vlan_device_event(dev, event);
 
-	if ((event == NETDEV_UP) &&
+	if ((event == NETDEV_REGISTER) &&
 	    (dev->features & NETIF_F_HW_VLAN_FILTER) &&
 	    dev->netdev_ops->ndo_vlan_rx_add_vid) {
 		pr_info("8021q: adding VLAN 0 to HW filter on device %s\n",

-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-06-11 23:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-03 20:07 [PATCH 1/2] vlan: only create special VLAN 0 once Jiri Bohac
2011-06-03 20:14 ` [PATCH 2/2] bonding: restore NETIF_F_VLAN_CHALLENGED properly in bond_del_vlan() Jiri Bohac
2011-06-04  0:26   ` Jay Vosburgh
2011-06-10 20:27     ` Jiri Bohac
2011-06-10 22:25       ` Jay Vosburgh
2011-06-11 23:13       ` David Miller
2011-06-05 21:28 ` [PATCH 1/2] vlan: only create special VLAN 0 once David Miller
2011-06-07 15:17   ` Patrick McHardy
2011-06-07 16:41     ` Jiri Bohac
2011-06-07 22:50       ` Patrick McHardy
2011-06-07 16:18   ` Jiri Bohac
2011-06-08  1:25     ` Jesse Gross
2011-06-09  0:01       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).