Skip to content

Commit

Permalink
cache-api: Avoid offset modification of nl_cache_ops
Browse files Browse the repository at this point in the history
Commit 18309ae has introduces a new member co_refcnt
(cache: Add reference counter to cache operations) which is
strictly required in order to provide thread safe cache ops
handling.

We have no choice but to modify nl_cache_ops but we might as
well do it at the end of the struct in order to minimize
ABI breakage to a minimum.

Also, adding some space for future expansion if we are beaking
ABI anyway.

Signed-off-by: Thomas Graf <[email protected]>
  • Loading branch information
tgraf committed Mar 19, 2013
1 parent b9331ce commit 1e30043
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions include/netlink/cache-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ struct nl_cache_ops
int co_hdrsize;
int co_protocol;

/** Reference counter */
unsigned int co_refcnt;

struct nl_af_group * co_groups;

/**
Expand All @@ -191,6 +188,19 @@ struct nl_cache_ops
struct nl_cache_ops *co_next;
struct nl_cache *co_major_cache;
struct genl_ops * co_genl;

/** Reference counter */
unsigned int co_refcnt;

void (*unused1)(void);
void (*unused2)(void);
void (*unused3)(void);
void (*unused4)(void);
void (*unused5)(void);
void (*unused6)(void);
void (*unused7)(void);
void (*unused8)(void);

struct nl_msgtype co_msgtypes[];
};

Expand Down

0 comments on commit 1e30043

Please sign in to comment.