aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip6_fib.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip6_fib.h')
-rw-r--r--include/net/ip6_fib.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 0ae759a6c76e..a192f7807659 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -107,7 +107,7 @@ struct rt6_info {
107 u32 rt6i_peer_genid; 107 u32 rt6i_peer_genid;
108 108
109 struct inet6_dev *rt6i_idev; 109 struct inet6_dev *rt6i_idev;
110 struct inet_peer *rt6i_peer; 110 unsigned long _rt6i_peer;
111 111
112#ifdef CONFIG_XFRM 112#ifdef CONFIG_XFRM
113 u32 rt6i_flow_cache_genid; 113 u32 rt6i_flow_cache_genid;
@@ -118,6 +118,36 @@ struct rt6_info {
118 u8 rt6i_protocol; 118 u8 rt6i_protocol;
119}; 119};
120 120
121static inline struct inet_peer *rt6_peer_ptr(struct rt6_info *rt)
122{
123 return inetpeer_ptr(rt->_rt6i_peer);
124}
125
126static inline bool rt6_has_peer(struct rt6_info *rt)
127{
128 return inetpeer_ptr_is_peer(rt->_rt6i_peer);
129}
130
131static inline void __rt6_set_peer(struct rt6_info *rt, struct inet_peer *peer)
132{
133 __inetpeer_ptr_set_peer(&rt->_rt6i_peer, peer);
134}
135
136static inline bool rt6_set_peer(struct rt6_info *rt, struct inet_peer *peer)
137{
138 return inetpeer_ptr_set_peer(&rt->_rt6i_peer, peer);
139}
140
141static inline void rt6_init_peer(struct rt6_info *rt, struct inet_peer_base *base)
142{
143 inetpeer_init_ptr(&rt->_rt6i_peer, base);
144}
145
146static inline void rt6_transfer_peer(struct rt6_info *rt, struct rt6_info *ort)
147{
148 inetpeer_transfer_peer(&rt->_rt6i_peer, &ort->_rt6i_peer);
149}
150
121static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) 151static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
122{ 152{
123 return ((struct rt6_info *)dst)->rt6i_idev; 153 return ((struct rt6_info *)dst)->rt6i_idev;
@@ -207,6 +237,7 @@ struct fib6_table {
207 u32 tb6_id; 237 u32 tb6_id;
208 rwlock_t tb6_lock; 238 rwlock_t tb6_lock;
209 struct fib6_node tb6_root; 239 struct fib6_node tb6_root;
240 struct inet_peer_base tb6_peers;
210}; 241};
211 242
212#define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC 243#define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC