RE: [PATCH net-next 0/7] Allow to monitor multicast cache event via rtnetlink
From: David Laight <hidden>
Date: 2012-12-07 10:43:42
On 12/06/12 at 09:43am, Nicolas Dichtel wrote:quoted
Le 05/12/2012 18:54, David Miller a écrit :quoted
From: "David Laight" <redacted> Date: Wed, 5 Dec 2012 11:41:33 -0000quoted
Probably worth commenting that the 64bit items might only be 32bit aligned. Just to stop anyone trying to read/write them with pointer casts.Rather, let's not create this situation at all. It's totally inappropriate to have special code to handle every single time we want to put 64-bit values into netlink messages. We need a real solution to this issue.The easiest way is to update *_ALIGNTO values (maybe we can keep NLMSG_ALIGNTO to 4). But I think that many userland apps have these values hardcoded and, the most important thing, this may increase size of many netlink messages. Hence we need probably to find something better.We can't do this, as you say, ALIGNTO is compiled into all the binaries. A simple backwards compatible workaround would be to include an unknown, empty padding attribute if needed. That would be 4 bytes in size and could be used to include padding as needed.
What are you going to align the data with respect to? I doubt you can assume that the start of the netlink message itself is 8 byte aligned - so any attempt to 8 byte align an item is probably doomed to failure. David