diff options
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r-- | include/linux/inetdevice.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index d5d05503a04b..3515ca64e638 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -26,7 +26,7 @@ struct in_device { | |||
26 | struct net_device *dev; | 26 | struct net_device *dev; |
27 | refcount_t refcnt; | 27 | refcount_t refcnt; |
28 | int dead; | 28 | int dead; |
29 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 29 | struct in_ifaddr __rcu *ifa_list;/* IP ifaddr chain */ |
30 | 30 | ||
31 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ | 31 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ |
32 | struct ip_mc_list __rcu * __rcu *mc_hash; | 32 | struct ip_mc_list __rcu * __rcu *mc_hash; |
@@ -136,7 +136,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
136 | 136 | ||
137 | struct in_ifaddr { | 137 | struct in_ifaddr { |
138 | struct hlist_node hash; | 138 | struct hlist_node hash; |
139 | struct in_ifaddr *ifa_next; | 139 | struct in_ifaddr __rcu *ifa_next; |
140 | struct in_device *ifa_dev; | 140 | struct in_device *ifa_dev; |
141 | struct rcu_head rcu_head; | 141 | struct rcu_head rcu_head; |
142 | __be32 ifa_local; | 142 | __be32 ifa_local; |
@@ -206,22 +206,13 @@ static __inline__ bool bad_mask(__be32 mask, __be32 addr) | |||
206 | return false; | 206 | return false; |
207 | } | 207 | } |
208 | 208 | ||
209 | #define for_primary_ifa(in_dev) { struct in_ifaddr *ifa; \ | ||
210 | for (ifa = (in_dev)->ifa_list; ifa && !(ifa->ifa_flags&IFA_F_SECONDARY); ifa = ifa->ifa_next) | ||
211 | |||
212 | #define for_ifa(in_dev) { struct in_ifaddr *ifa; \ | ||
213 | for (ifa = (in_dev)->ifa_list; ifa; ifa = ifa->ifa_next) | ||
214 | |||
215 | |||
216 | #define endfor_ifa(in_dev) } | ||
217 | |||
218 | #define in_dev_for_each_ifa_rtnl(ifa, in_dev) \ | 209 | #define in_dev_for_each_ifa_rtnl(ifa, in_dev) \ |
219 | for (ifa = (in_dev)->ifa_list; ifa; \ | 210 | for (ifa = rtnl_dereference((in_dev)->ifa_list); ifa; \ |
220 | ifa = ifa->ifa_next) | 211 | ifa = rtnl_dereference(ifa->ifa_next)) |
221 | 212 | ||
222 | #define in_dev_for_each_ifa_rcu(ifa, in_dev) \ | 213 | #define in_dev_for_each_ifa_rcu(ifa, in_dev) \ |
223 | for (ifa = (in_dev)->ifa_list; ifa; \ | 214 | for (ifa = rcu_dereference((in_dev)->ifa_list); ifa; \ |
224 | ifa = ifa->ifa_next) | 215 | ifa = rcu_dereference(ifa->ifa_next)) |
225 | 216 | ||
226 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) | 217 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) |
227 | { | 218 | { |