Skip to content

Commit

Permalink
neigh: Create mechanism for generic neigh private areas.
Browse files Browse the repository at this point in the history
The implementation private sits right after the primary_key memory.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Miller committed Nov 30, 2011
1 parent 449fa02 commit 1026fec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/net/neighbour.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1026fec

Please sign in to comment.