From: Lutz Jaenicke <ljaenicke@innominate.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] rtnl_wilddump_request: fix alignment issue for embedded platforms
Date: Thu, 30 Aug 2012 18:09:48 +0200 [thread overview]
Message-ID: <20120830160948.GA26387@lutz.bln.innominate.local> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6FC9@saturn3.aculab.com>
On Thu, Aug 30, 2012 at 04:51:49PM +0100, David Laight wrote:
> > + /* attribute has to be NLMSG aligned */
> > + struct rtattr ext_req
> __attribute__((aligned(NLMSG_ALIGNTO)));
>
> Would it be better to apply the attribute to the definition
> of 'struct rtattr' itself ?
'struct rtattr' is defined in a kernel header and I am not really sure
what kind of side effects it would have.
The problem I intend to solve with my page is rather caused by the use case:
The request is sent as a single structure, the processing is however
performed step by step: first the nlmsg is parsed, then the pointer
is moved on to the parsing of the content. This pointer is hoever not
oriented at the structure element but by using size information which
is then adjust by NLMSG_ALIGN() etc. Consequently one should actually
use the same method in sending (generate the header first, then addattr_()
which enforces protocol conform alignment). This is the way all other
instances in iproute2 generate their messages btw.
I hence consider my proposed patch to be the least intrusive solution.
Best regards,
Lutz
--
Dr.-Ing. Lutz Jänicke
CTO
Innominate Security Technologies AG /protecting industrial networks/
tel: +49.30.921028-200
fax: +49.30.921028-020
Rudower Chaussee 13
D-12489 Berlin, Germany
www.innominate.com
Register Court: AG Charlottenburg, HR B 81603
Management Board: Dirk Seewald
Chairman of the Supervisory Board: Christoph Leifer
prev parent reply other threads:[~2012-08-30 16:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 7:38 [PATCH] iproute2: rtnl_wilddump_request: fix alignment for embedded platforms Lutz Jaenicke
2012-08-30 15:01 ` [PATCH] rtnl_wilddump_request: fix alignment issue " Lutz Jaenicke
2012-08-30 15:51 ` David Laight
2012-08-30 16:09 ` Lutz Jaenicke [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120830160948.GA26387@lutz.bln.innominate.local \
--to=ljaenicke@innominate.com \
--cc=David.Laight@ACULAB.COM \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox