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 /net/8021q/vlan_netlink.c | |
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 'net/8021q/vlan_netlink.c')
-rw-r--r-- | net/8021q/vlan_netlink.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c index 0996185e2ed5..9ee63583ed27 100644 --- a/net/8021q/vlan_netlink.c +++ b/net/8021q/vlan_netlink.c | |||
@@ -137,11 +137,6 @@ static int vlan_newlink(struct net_device *dev, | |||
137 | return register_vlan_dev(dev); | 137 | return register_vlan_dev(dev); |
138 | } | 138 | } |
139 | 139 | ||
140 | static void vlan_dellink(struct net_device *dev) | ||
141 | { | ||
142 | unregister_vlan_device(dev); | ||
143 | } | ||
144 | |||
145 | static inline size_t vlan_qos_map_size(unsigned int n) | 140 | static inline size_t vlan_qos_map_size(unsigned int n) |
146 | { | 141 | { |
147 | if (n == 0) | 142 | if (n == 0) |
@@ -226,7 +221,7 @@ struct rtnl_link_ops vlan_link_ops __read_mostly = { | |||
226 | .validate = vlan_validate, | 221 | .validate = vlan_validate, |
227 | .newlink = vlan_newlink, | 222 | .newlink = vlan_newlink, |
228 | .changelink = vlan_changelink, | 223 | .changelink = vlan_changelink, |
229 | .dellink = vlan_dellink, | 224 | .dellink = unregister_vlan_dev, |
230 | .get_size = vlan_get_size, | 225 | .get_size = vlan_get_size, |
231 | .fill_info = vlan_fill_info, | 226 | .fill_info = vlan_fill_info, |
232 | }; | 227 | }; |