[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090402095957.GA30799@gondor.apana.org.au>
Date: Thu, 2 Apr 2009 17:59:57 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: David Miller <davem@...emloft.net>
Cc: kaber@...sh.net, nhorman@...driver.com, zbr@...emap.net,
netdev@...r.kernel.org, kuznet@....inr.ac.ru, pekkas@...core.fi,
jmorris@...ei.org, yoshfuji@...ux-ipv6.org
Subject: Re: [Patch 4/5] Network Drop Monitor: Adding drop monitor
implementation & Netlink protocol
On Thu, Apr 02, 2009 at 02:52:23AM -0700, David Miller wrote:
>
> It has to do with how the netlink attributes get packed together
> into the messages. It's this crap:
>
> #define NLMSG_ALIGNTO 4
> #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
> ...
> #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
> (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
>
> Thus, nothing in an nlmsg can ever be more than 4 byte aligned.
> And this is hard coded into the protocol.
Ah yes, this is the killer.
I suppose we can modify in-kernel helpers like nla_parse to deal
with that by copying if it's unaligned. Though we'll have to
figure out how to free the memory.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists