diff options
author | David S. Miller <davem@davemloft.net> | 2011-07-18 02:09:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-18 02:11:35 -0400 |
commit | 69cce1d1404968f78b177a0314f5822d5afdbbfb (patch) | |
tree | 26223264fd69ea8078d0013fd5a76eb7aeb04c12 /include/net | |
parent | 9cbb7ecbcff85077bb12301aaf4c9b5a56c5993d (diff) |
net: Abstract dst->neighbour accesses behind helpers.
dst_{get,set}_neighbour()
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/dst.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 0dd7ccbc0dd5..8147206eefb9 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -37,7 +37,7 @@ struct dst_entry { | |||
37 | unsigned long _metrics; | 37 | unsigned long _metrics; |
38 | unsigned long expires; | 38 | unsigned long expires; |
39 | struct dst_entry *path; | 39 | struct dst_entry *path; |
40 | struct neighbour *neighbour; | 40 | struct neighbour *_neighbour; |
41 | #ifdef CONFIG_XFRM | 41 | #ifdef CONFIG_XFRM |
42 | struct xfrm_state *xfrm; | 42 | struct xfrm_state *xfrm; |
43 | #else | 43 | #else |
@@ -86,6 +86,16 @@ struct dst_entry { | |||
86 | }; | 86 | }; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst) | ||
90 | { | ||
91 | return dst->_neighbour; | ||
92 | } | ||
93 | |||
94 | static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) | ||
95 | { | ||
96 | dst->_neighbour = neigh; | ||
97 | } | ||
98 | |||
89 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); | 99 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); |
90 | extern const u32 dst_default_metrics[RTAX_MAX]; | 100 | extern const u32 dst_default_metrics[RTAX_MAX]; |
91 | 101 | ||
@@ -371,8 +381,10 @@ static inline void dst_rcu_free(struct rcu_head *head) | |||
371 | 381 | ||
372 | static inline void dst_confirm(struct dst_entry *dst) | 382 | static inline void dst_confirm(struct dst_entry *dst) |
373 | { | 383 | { |
374 | if (dst) | 384 | if (dst) { |
375 | neigh_confirm(dst->neighbour); | 385 | struct neighbour *n = dst_get_neighbour(dst); |
386 | neigh_confirm(n); | ||
387 | } | ||
376 | } | 388 | } |
377 | 389 | ||
378 | static inline void dst_link_failure(struct sk_buff *skb) | 390 | static inline void dst_link_failure(struct sk_buff *skb) |