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.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 10c913816032..34ec321d6a03 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -129,6 +129,8 @@ struct rt6_exception {
129 129
130struct rt6_info { 130struct rt6_info {
131 struct dst_entry dst; 131 struct dst_entry dst;
132 struct rt6_info __rcu *rt6_next;
133 struct rt6_info *from;
132 134
133 /* 135 /*
134 * Tail elements of dst_entry (__refcnt etc.) 136 * Tail elements of dst_entry (__refcnt etc.)
@@ -147,6 +149,7 @@ struct rt6_info {
147 */ 149 */
148 struct list_head rt6i_siblings; 150 struct list_head rt6i_siblings;
149 unsigned int rt6i_nsiblings; 151 unsigned int rt6i_nsiblings;
152 atomic_t rt6i_nh_upper_bound;
150 153
151 atomic_t rt6i_ref; 154 atomic_t rt6i_ref;
152 155
@@ -168,19 +171,21 @@ struct rt6_info {
168 u32 rt6i_metric; 171 u32 rt6i_metric;
169 u32 rt6i_pmtu; 172 u32 rt6i_pmtu;
170 /* more non-fragment space at head required */ 173 /* more non-fragment space at head required */
174 int rt6i_nh_weight;
171 unsigned short rt6i_nfheader_len; 175 unsigned short rt6i_nfheader_len;
172 u8 rt6i_protocol; 176 u8 rt6i_protocol;
173 u8 exception_bucket_flushed:1, 177 u8 exception_bucket_flushed:1,
174 unused:7; 178 should_flush:1,
179 unused:6;
175}; 180};
176 181
177#define for_each_fib6_node_rt_rcu(fn) \ 182#define for_each_fib6_node_rt_rcu(fn) \
178 for (rt = rcu_dereference((fn)->leaf); rt; \ 183 for (rt = rcu_dereference((fn)->leaf); rt; \
179 rt = rcu_dereference(rt->dst.rt6_next)) 184 rt = rcu_dereference(rt->rt6_next))
180 185
181#define for_each_fib6_walker_rt(w) \ 186#define for_each_fib6_walker_rt(w) \
182 for (rt = (w)->leaf; rt; \ 187 for (rt = (w)->leaf; rt; \
183 rt = rcu_dereference_protected(rt->dst.rt6_next, 1)) 188 rt = rcu_dereference_protected(rt->rt6_next, 1))
184 189
185static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) 190static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
186{ 191{
@@ -203,11 +208,9 @@ static inline void rt6_update_expires(struct rt6_info *rt0, int timeout)
203{ 208{
204 struct rt6_info *rt; 209 struct rt6_info *rt;
205 210
206 for (rt = rt0; rt && !(rt->rt6i_flags & RTF_EXPIRES); 211 for (rt = rt0; rt && !(rt->rt6i_flags & RTF_EXPIRES); rt = rt->from);
207 rt = (struct rt6_info *)rt->dst.from);
208 if (rt && rt != rt0) 212 if (rt && rt != rt0)
209 rt0->dst.expires = rt->dst.expires; 213 rt0->dst.expires = rt->dst.expires;
210
211 dst_set_expires(&rt0->dst, timeout); 214 dst_set_expires(&rt0->dst, timeout);
212 rt0->rt6i_flags |= RTF_EXPIRES; 215 rt0->rt6i_flags |= RTF_EXPIRES;
213} 216}
@@ -242,8 +245,8 @@ static inline u32 rt6_get_cookie(const struct rt6_info *rt)
242 u32 cookie = 0; 245 u32 cookie = 0;
243 246
244 if (rt->rt6i_flags & RTF_PCPU || 247 if (rt->rt6i_flags & RTF_PCPU ||
245 (unlikely(!list_empty(&rt->rt6i_uncached)) && rt->dst.from)) 248 (unlikely(!list_empty(&rt->rt6i_uncached)) && rt->from))
246 rt = (struct rt6_info *)(rt->dst.from); 249 rt = rt->from;
247 250
248 rt6_get_cookie_safe(rt, &cookie); 251 rt6_get_cookie_safe(rt, &cookie);
249 252
@@ -404,6 +407,7 @@ unsigned int fib6_tables_seq_read(struct net *net);
404int fib6_tables_dump(struct net *net, struct notifier_block *nb); 407int fib6_tables_dump(struct net *net, struct notifier_block *nb);
405 408
406void fib6_update_sernum(struct rt6_info *rt); 409void fib6_update_sernum(struct rt6_info *rt);
410void fib6_update_sernum_upto_root(struct net *net, struct rt6_info *rt);
407 411
408#ifdef CONFIG_IPV6_MULTIPLE_TABLES 412#ifdef CONFIG_IPV6_MULTIPLE_TABLES
409int fib6_rules_init(void); 413int fib6_rules_init(void);