From daaba4fa17d7826807b0b131f796543b4099ef4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?YOSHIFUJI=20Hideaki=20/=20=E5=90=89=E8=97=A4=E8=8B=B1?= =?UTF-8?q?=E6=98=8E?= Date: Sat, 9 Feb 2013 07:00:59 +0000 Subject: net neighbour, decnet: Ensure to align device private data on preferred alignment. To allow both of protocol-specific data and device-specific data attached with neighbour entry, and to eliminate size calculation cost when allocating entry, sizeof protocol-speicic data must be multiple of NEIGH_PRIV_ALIGN. On 64bit archs, sizeof(struct dn_neigh) is multiple of NEIGH_PRIV_ALIGN, but on 32bit archs, it was not. Introduce NEIGH_ENTRY_SPACE() macro to ensure that protocol-specific entry-size meets our requirement. Reported-by: Fengguang Wu Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- include/net/neighbour.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/net') diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 629ee573c6d0..7e748ad8b50c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -181,6 +181,7 @@ struct neigh_table { }; #define NEIGH_PRIV_ALIGN sizeof(long long) +#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) static inline void *neighbour_priv(const struct neighbour *n) { -- cgit v1.2.3