Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88046
b: refs/heads/master
c: 802fb17
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 2, 2008
1 parent e13cecd commit 6d1c52c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f32c5f2c3866bf4d932d2bc42216dafb90a50ab7
refs/heads/master: 802fb176d8c635ae42da31b80841c26e8c7338a0
20 changes: 19 additions & 1 deletion trunk/net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions trunk/net/8021q/vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ void vlan_netlink_fini(void);

extern struct rtnl_link_ops vlan_link_ops;

static inline int is_vlan_dev(struct net_device *dev)
{
return dev->priv_flags & IFF_802_1Q_VLAN;
}

#endif /* !(__BEN_VLAN_802_1Q_INC__) */
5 changes: 0 additions & 5 deletions trunk/net/8021q/vlanproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,6 @@ int vlan_proc_rem_dev(struct net_device *vlandev)
* The following few functions build the content of /proc/net/vlan/config
*/

static inline int is_vlan_dev(struct net_device *dev)
{
return dev->priv_flags & IFF_802_1Q_VLAN;
}

/* start read of /proc/net/vlan/config */
static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(dev_base_lock)
Expand Down

0 comments on commit 6d1c52c

Please sign in to comment.