]> git.proxmox.com Git - mirror_iproute2.git/commit - lib/libnetlink.c
rtnl_wilddump_request: fix alignment issue for embedded platforms
authorLutz Jaenicke <ljaenicke@innominate.com>
Thu, 30 Aug 2012 05:01:34 +0000 (05:01 +0000)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Tue, 19 Feb 2013 15:45:59 +0000 (07:45 -0800)
commit257422f77fc2a11429a3f86dea0a740752d15d19
treed6d52f7b26f9c874328f35e85e61c9e268577efe
parentf21963fdff59959a5958db1f9723f7fb85efba23
rtnl_wilddump_request: fix alignment issue for embedded platforms

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

Tested on:
  ARM      (32bit Big Endian)
  PowerPC  (32bit Big Endian)
  x86_64   (64bit Little Endian)
Each with different aligment requirments.

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
lib/libnetlink.c