dummy.c (c6380ecd8e9bee7aba3d9a5a94b58168244c4a61) dummy.c (554873e517115c4b7207259f1cadfd77d90b5395)
1/* dummy.c: a dummy net driver
2
3 The purpose of this driver is to provide a device to point a
4 route through, but not to actually transmit packets.
5
6 Why? If you have a machine whose only connection is an occasional
7 PPP/SLIP/PLIP link, you can only connect to your own hostname
8 when the link is up. Otherwise you have to use localhost.

--- 205 unchanged lines hidden (view full) ---

214 free_netdev(dev_dummy);
215 return err;
216}
217
218static int __init dummy_init_module(void)
219{
220 int i, err = 0;
221
1/* dummy.c: a dummy net driver
2
3 The purpose of this driver is to provide a device to point a
4 route through, but not to actually transmit packets.
5
6 Why? If you have a machine whose only connection is an occasional
7 PPP/SLIP/PLIP link, you can only connect to your own hostname
8 when the link is up. Otherwise you have to use localhost.

--- 205 unchanged lines hidden (view full) ---

214 free_netdev(dev_dummy);
215 return err;
216}
217
218static int __init dummy_init_module(void)
219{
220 int i, err = 0;
221
222 down_write(&pernet_ops_rwsem);
222 rtnl_lock();
223 err = __rtnl_link_register(&dummy_link_ops);
224 if (err < 0)
225 goto out;
226
227 for (i = 0; i < numdummies && !err; i++) {
228 err = dummy_init_one();
229 cond_resched();
230 }
231 if (err < 0)
232 __rtnl_link_unregister(&dummy_link_ops);
233
234out:
235 rtnl_unlock();
223 rtnl_lock();
224 err = __rtnl_link_register(&dummy_link_ops);
225 if (err < 0)
226 goto out;
227
228 for (i = 0; i < numdummies && !err; i++) {
229 err = dummy_init_one();
230 cond_resched();
231 }
232 if (err < 0)
233 __rtnl_link_unregister(&dummy_link_ops);
234
235out:
236 rtnl_unlock();
237 up_write(&pernet_ops_rwsem);
236
237 return err;
238}
239
240static void __exit dummy_cleanup_module(void)
241{
242 rtnl_link_unregister(&dummy_link_ops);
243}
244
245module_init(dummy_init_module);
246module_exit(dummy_cleanup_module);
247MODULE_LICENSE("GPL");
248MODULE_ALIAS_RTNL_LINK(DRV_NAME);
249MODULE_VERSION(DRV_VERSION);
238
239 return err;
240}
241
242static void __exit dummy_cleanup_module(void)
243{
244 rtnl_link_unregister(&dummy_link_ops);
245}
246
247module_init(dummy_init_module);
248module_exit(dummy_cleanup_module);
249MODULE_LICENSE("GPL");
250MODULE_ALIAS_RTNL_LINK(DRV_NAME);
251MODULE_VERSION(DRV_VERSION);