diff options
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r-- | net/8021q/vlan.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index dbc81b965096..b33410abfd6b 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -374,17 +374,35 @@ static void vlan_sync_address(struct net_device *dev, | |||
374 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); | 374 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); |
375 | } | 375 | } |
376 | 376 | ||
377 | static void __vlan_device_event(struct net_device *dev, unsigned long event) | ||
378 | { | ||
379 | switch (event) { | ||
380 | case NETDEV_CHANGENAME: | ||
381 | vlan_proc_rem_dev(dev); | ||
382 | if (vlan_proc_add_dev(dev) < 0) | ||
383 | pr_warning("8021q: failed to change proc name for %s\n", | ||
384 | dev->name); | ||
385 | break; | ||
386 | } | ||
387 | } | ||
388 | |||
377 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, | 389 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, |
378 | void *ptr) | 390 | void *ptr) |
379 | { | 391 | { |
380 | struct net_device *dev = ptr; | 392 | struct net_device *dev = ptr; |
381 | struct vlan_group *grp = __vlan_find_group(dev->ifindex); | 393 | struct vlan_group *grp; |
382 | int i, flgs; | 394 | int i, flgs; |
383 | struct net_device *vlandev; | 395 | struct net_device *vlandev; |
384 | 396 | ||
385 | if (dev->nd_net != &init_net) | 397 | if (dev->nd_net != &init_net) |
386 | return NOTIFY_DONE; | 398 | return NOTIFY_DONE; |
387 | 399 | ||
400 | if (is_vlan_dev(dev)) { | ||
401 | __vlan_device_event(dev, event); | ||
402 | goto out; | ||
403 | } | ||
404 | |||
405 | grp = __vlan_find_group(dev->ifindex); | ||
388 | if (!grp) | 406 | if (!grp) |
389 | goto out; | 407 | goto out; |
390 | 408 | ||