From: David Miller Date: Mon, 25 Jul 2011 00:01:17 +0000 (+0000) Subject: neigh: Create mechanism for generic neigh private areas. X-Git-Tag: v3.3-rc1~182^2~401 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1026fec8739663621d64216ba939c23bc1d089b7;p=profile%2Fivi%2Fkernel-x86-ivi.git neigh: Create mechanism for generic neigh private areas. The implementation private sits right after the primary_key memory. Signed-off-by: David S. Miller --- diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 7ae5acf..87c0e5c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -179,6 +179,13 @@ struct neigh_table { struct pneigh_entry **phash_buckets; }; +#define NEIGH_PRIV_ALIGN sizeof(long long) + +static inline void *neighbour_priv(const struct neighbour *n) +{ + return (char *)n + ALIGN(sizeof(*n) + n->tbl->key_len, NEIGH_PRIV_ALIGN); +} + /* flags for neigh_update() */ #define NEIGH_UPDATE_F_OVERRIDE 0x00000001 #define NEIGH_UPDATE_F_WEAK_OVERRIDE 0x00000002