On Thu, Aug 24, 2000 at 09:33:31AM -0700, Jean Tourrilhes wrote:
> On Thu, Aug 24, 2000 at 01:46:12AM -0700, Dag Brattli wrote:
> > Hi Jean,
> >
> > The reason for the memset was to clear the net_device struct and this is
> > needed in Linux-2.2. In Linux-2.4, the memset is done by dev_alloc() itself,
> > so I cannot see any reason for us to do that. The bug as I saw it was only
> > that some old 2.2 code was passed on to 2.4.
> >
> > I have tried to fire up to irda devices here, and I have not problems at
> > all!?
> >
> > What am I missing here?
>
> The dev->name of any irtty device is truncated to
> "irda". Check by yourself with an ifconfig. The trouble is that you
> can't have 2 irtty active at the same time.
I'm so stupid, there is an even better way to do it
right. Just replace the contentious line with :
------------------------------------------
/* dev_alloc doesn't clear the struct */
memset(((__u8*)dev)+sizeof(dev->name),0,sizeof(struct
net_device)-sizeof(dev->name));
------------------------------------------
This is much more readable, and this way, whatever the
definition of dev->name become, we will do the right thing. And it's
compatible for both 2.2 and 2.4. Magic !
Jean
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www4.pasta.cs.UiT.No/mailman/listinfo/linux-irda