[Devel] Re: [PATCH 1/9] network namespaces: core and device list

Stephen Hemminger shemminger at osdl.org
Wed Aug 16 09:45:28 PDT 2006


On Wed, 16 Aug 2006 07:46:43 -0700
Dave Hansen <haveblue at us.ibm.com> wrote:

> On Tue, 2006-08-15 at 18:48 +0400, Andrey Savochkin wrote:
> > 
> >         /* Can survive without statistics */
> >         stats = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
> >         if (stats) {
> >                 memset(stats, 0, sizeof(struct net_device_stats));
> > -               loopback_dev.priv = stats;
> > -               loopback_dev.get_stats = &get_stats;
> > +               dev->priv = stats;
> > +               dev->get_stats = &get_stats;
> >         } 
> 
> With this much surgery it might be best to start using things that have
> come along since this code was touched last, like kzalloc().
> 
>

If you are going to make the loopback device dynamic, it MUST use
alloc_netdev().




More information about the Devel mailing list