summaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-02 00:08:01 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-02 00:08:01 -0700
commit802fb176d8c635ae42da31b80841c26e8c7338a0 (patch)
tree3f0a1283ca650868fd41942fb13e5ada129788c7 /net/8021q/vlan.c
parentf32c5f2c3866bf4d932d2bc42216dafb90a50ab7 (diff)
downloadop-kernel-dev-802fb176d8c635ae42da31b80841c26e8c7338a0.zip
op-kernel-dev-802fb176d8c635ae42da31b80841c26e8c7338a0.tar.gz
[VLAN]: Proc entry is not renamed when vlan device name changes.
This may lead to situations, when each of two proc entries produce data for the other's device. Looks like a BUG, so this patch is for net-2.6. It will not apply to net-2.6.26 since dev->nd_net access is replaced with dev_net(dev) one. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r--net/8021q/vlan.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index dbc81b9..b33410a 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -374,17 +374,35 @@ static void vlan_sync_address(struct net_device *dev,
memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN);
}
+static void __vlan_device_event(struct net_device *dev, unsigned long event)
+{
+ switch (event) {
+ case NETDEV_CHANGENAME:
+ vlan_proc_rem_dev(dev);
+ if (vlan_proc_add_dev(dev) < 0)
+ pr_warning("8021q: failed to change proc name for %s\n",
+ dev->name);
+ break;
+ }
+}
+
static int vlan_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
{
struct net_device *dev = ptr;
- struct vlan_group *grp = __vlan_find_group(dev->ifindex);
+ struct vlan_group *grp;
int i, flgs;
struct net_device *vlandev;
if (dev->nd_net != &init_net)
return NOTIFY_DONE;
+ if (is_vlan_dev(dev)) {
+ __vlan_device_event(dev, event);
+ goto out;
+ }
+
+ grp = __vlan_find_group(dev->ifindex);
if (!grp)
goto out;
OpenPOWER on IntegriCloud