neigh: Create mechanism for generic neigh private areas.
authorDavid Miller <davem@davemloft.net>
Mon, 25 Jul 2011 00:01:17 +0000 (00:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2011 23:46:43 +0000 (18:46 -0500)
The implementation private sits right after the primary_key memory.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/neighbour.h

index 7ae5acff96e9b42456e53cea5f86a98d9864dfd9..87c0e5ce6492d6ed4c6b0d79d3765d6b35ced2c7 100644 (file)
@@ -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