diff options
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 95615c9ad13a..41b1ce6c96a8 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
22 | #include <linux/rcupdate.h> | 22 | #include <linux/rcupdate.h> |
23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
24 | #include <linux/bitmap.h> | ||
24 | 25 | ||
25 | #include <linux/err.h> | 26 | #include <linux/err.h> |
26 | #include <linux/sysctl.h> | 27 | #include <linux/sysctl.h> |
@@ -81,16 +82,28 @@ struct neigh_parms { | |||
81 | 82 | ||
82 | int reachable_time; | 83 | int reachable_time; |
83 | int data[NEIGH_VAR_DATA_MAX]; | 84 | int data[NEIGH_VAR_DATA_MAX]; |
85 | DECLARE_BITMAP(data_state, NEIGH_VAR_DATA_MAX); | ||
84 | }; | 86 | }; |
85 | 87 | ||
86 | static inline void neigh_var_set(struct neigh_parms *p, int index, int val) | 88 | static inline void neigh_var_set(struct neigh_parms *p, int index, int val) |
87 | { | 89 | { |
90 | set_bit(index, p->data_state); | ||
88 | p->data[index] = val; | 91 | p->data[index] = val; |
89 | } | 92 | } |
90 | 93 | ||
91 | #define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr]) | 94 | #define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr]) |
92 | #define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val) | 95 | #define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val) |
93 | 96 | ||
97 | static inline void neigh_parms_data_state_setall(struct neigh_parms *p) | ||
98 | { | ||
99 | bitmap_fill(p->data_state, NEIGH_VAR_DATA_MAX); | ||
100 | } | ||
101 | |||
102 | static inline void neigh_parms_data_state_cleanall(struct neigh_parms *p) | ||
103 | { | ||
104 | bitmap_zero(p->data_state, NEIGH_VAR_DATA_MAX); | ||
105 | } | ||
106 | |||
94 | struct neigh_statistics { | 107 | struct neigh_statistics { |
95 | unsigned long allocs; /* number of allocated neighs */ | 108 | unsigned long allocs; /* number of allocated neighs */ |
96 | unsigned long destroys; /* number of destroyed neighs */ | 109 | unsigned long destroys; /* number of destroyed neighs */ |