summaryrefslogtreecommitdiffstats
path: root/include/net/neighbour.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-01-09 08:13:47 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-16 14:31:58 -0500
commit89740ca74f5bb45d3e0dcb4aa9eab0ba9864bff5 (patch)
tree378e227ef6c2bd2776afc4d6c29d89574fdee9c6 /include/net/neighbour.h
parentd6e26404732ac5d82ee34e197c35241d581d1c4c (diff)
neigh: use NEIGH_VAR_INIT in ndo_neigh_setup functions.
When ndo_neigh_setup is called, the bitfield used by NEIGH_VAR_SET is not initialized yet. This might cause confusion for the people who use NEIGH_VAR_SET in ndo_neigh_setup. So rather introduce NEIGH_VAR_INIT for usage in ndo_neigh_setup. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r--include/net/neighbour.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 4c09bd23b832..7277caf3743d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -92,6 +92,11 @@ static inline void neigh_var_set(struct neigh_parms *p, int index, int val)
92} 92}
93 93
94#define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr]) 94#define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr])
95
96/* In ndo_neigh_setup, NEIGH_VAR_INIT should be used.
97 * In other cases, NEIGH_VAR_SET should be used.
98 */
99#define NEIGH_VAR_INIT(p, attr, val) (NEIGH_VAR(p, attr) = val)
95#define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val) 100#define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val)
96 101
97static inline void neigh_parms_data_state_setall(struct neigh_parms *p) 102static inline void neigh_parms_data_state_setall(struct neigh_parms *p)