From: Lutz Jaenicke <ljaenicke@innominate.com>
To: netdev@vger.kernel.org
Cc: Lutz Jaenicke <ljaenicke@innominate.com>
Subject: [PATCH] iproute2: rtnl_wilddump_request: fix alignment for embedded platforms
Date: Wed, 22 Aug 2012 09:38:53 +0200 [thread overview]
Message-ID: <1345621133-23583-1-git-send-email-ljaenicke@innominate.com> (raw)
Platforms have different alignment requirements which need to be
fulfilled by the compiler. If the structure elements are already
4 byte (NLMGS_ALIGNTO) aligned by the compiler adding an explicit
padding element (align_rta) is not allowed.
Use __attribute__ ((aligned (NLMSG_ALIGNTO))) in order to achieve
the required alignment.
Experienced on ARM (xscale) with symptom
netlink: 12 bytes leftover after parsing attributes
Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
---
lib/libnetlink.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 8e8c8b9..05701ef 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -94,10 +94,9 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
struct {
struct nlmsghdr nlh;
struct rtgenmsg g;
- __u16 align_rta; /* attribute has to be 32bit aligned */
struct rtattr ext_req;
__u32 ext_filter_mask;
- } req;
+ } req __attribute__ ((aligned (NLMSG_ALIGNTO)));
memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = sizeof(req);
--
1.7.2.5
next reply other threads:[~2012-08-22 7:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 7:38 Lutz Jaenicke [this message]
2012-08-30 15:01 ` [PATCH] rtnl_wilddump_request: fix alignment issue for embedded platforms Lutz Jaenicke
2012-08-30 15:51 ` David Laight
2012-08-30 16:09 ` Lutz Jaenicke
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=1345621133-23583-1-git-send-email-ljaenicke@innominate.com \
--to=ljaenicke@innominate.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