Subject: Re: status of the mbuf API SoC project
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Pavel Cahyna <firstname.lastname@example.org>
Date: 09/05/2006 10:31:57
On Mon, Sep 04, 2006 at 12:43:01AM -0400, der Mouse wrote:
> > I've added two macros to replace mtod: mptr and mptr_rw.
> > const datatype *
> > mptr(struct mbuf **mp, datatype, int off, int flags);
> > [...and three others...]
> > differences from mtod:
> > - the new macros accept an offset, to access structures which are not
> > at the beginning of the packet.
> Shouldn't a redesign of mtod also include a way to deal with the
> alignment issue? I've seen code all over the place that blindly
> assumes a pointer returned from mtod is correctly aligned, something
> which has bit me more than once.
BTW how exactly have you been byten by that, considering that packet
header structures are declared as __packed and don't require alignment?