On 14/10/14(Tue) 14:18, Claudio Jeker wrote: > On Tue, Oct 14, 2014 at 11:01:46AM +0200, Martin Pieuchot wrote: > > On 08/10/14(Wed) 14:29, Martin Pieuchot wrote: > > > I'm looking after the uses of the global list of interface. These ones > > > are pointless, you always have at least one interface on your system. > > > > > > Ok? > > > > Anyone? > > OK. But we should make loopattach() panic if it fails to clone lo0.
Makes sense, here's the diff. Index: net/if_loop.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_loop.c,v retrieving revision 1.58 diff -u -p -r1.58 if_loop.c --- net/if_loop.c 7 Oct 2014 08:47:28 -0000 1.58 +++ net/if_loop.c 14 Oct 2014 12:39:50 -0000 @@ -154,7 +154,9 @@ struct if_clone loop_cloner = void loopattach(int n) { - (void) loop_clone_create(&loop_cloner, 0); + if (loop_clone_create(&loop_cloner, 0)) + panic("unable to create lo0"); + if_clone_attach(&loop_cloner); }