diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-21 03:25:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:08:31 -0500 |
commit | af30151709bcace1ca844d4bb8b7e2e392ff81eb (patch) | |
tree | 5da346ea833fe8097359613463cd716613359215 /include/linux | |
parent | acc5efbcd2a023c8801f2bba39971cf93812ce7c (diff) |
[VLAN]: Simplify vlan unregistration
Keep track of the number of VLAN devices in a vlan group. This allows
to have the caller sense when the group is going to be destroyed and
stop using it, which in turn allows to remove the wrapper around
unregister_vlan_dev for the NETDEV_UNREGISTER notifier and avoid
iterating over all possible VLAN ids whenever a device in unregistered.
Also fix what looks like a use-after-free (but is actually safe since
we're holding the RTNL), the real_dev reference should not be dropped
while we still use it.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/if_vlan.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 07db4169463e..129fa876dbe4 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -82,6 +82,7 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | |||
82 | 82 | ||
83 | struct vlan_group { | 83 | struct vlan_group { |
84 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ | 84 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ |
85 | unsigned int nr_vlans; | ||
85 | struct hlist_node hlist; /* linked list */ | 86 | struct hlist_node hlist; /* linked list */ |
86 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 87 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
87 | struct rcu_head rcu; | 88 | struct rcu_head rcu; |