aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/rtnetlink.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-27 03:06:36 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 05:22:07 -0400
commit23289a37e2b127dfc4de1313fba15bb4c9f0cd5b (patch)
tree209edb2cb43dedb97477e1297873ada4759a1066 /net/core/rtnetlink.c
parent9b5e383c11b08784eb0087617f880077982ef769 (diff)
net: add a list_head parameter to dellink() method
Adding a list_head parameter to rtnl_link_ops->dellink() methods allow us to queue devices on a list, in order to dismantle them all at once. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r--net/core/rtnetlink.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 52ea418d5302..391a62cd9df6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -248,7 +248,7 @@ static LIST_HEAD(link_ops);
248int __rtnl_link_register(struct rtnl_link_ops *ops) 248int __rtnl_link_register(struct rtnl_link_ops *ops)
249{ 249{
250 if (!ops->dellink) 250 if (!ops->dellink)
251 ops->dellink = unregister_netdevice; 251 ops->dellink = unregister_netdevice_queue;
252 252
253 list_add_tail(&ops->list, &link_ops); 253 list_add_tail(&ops->list, &link_ops);
254 return 0; 254 return 0;
@@ -277,13 +277,13 @@ EXPORT_SYMBOL_GPL(rtnl_link_register);
277static void __rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops) 277static void __rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops)
278{ 278{
279 struct net_device *dev; 279 struct net_device *dev;
280restart: 280 LIST_HEAD(list_kill);
281
281 for_each_netdev(net, dev) { 282 for_each_netdev(net, dev) {
282 if (dev->rtnl_link_ops == ops) { 283 if (dev->rtnl_link_ops == ops)
283 ops->dellink(dev); 284 ops->dellink(dev, &list_kill);
284 goto restart;
285 }
286 } 285 }
286 unregister_netdevice_many(&list_kill);
287} 287}
288 288
289void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops) 289void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops)
@@ -972,7 +972,7 @@ static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
972 if (!ops) 972 if (!ops)
973 return -EOPNOTSUPP; 973 return -EOPNOTSUPP;
974 974
975 ops->dellink(dev); 975 ops->dellink(dev, NULL);
976 return 0; 976 return 0;
977} 977}
978 978