aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/fib_rules.h2
-rw-r--r--include/net/ip_fib.h26
2 files changed, 10 insertions, 18 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index e584de16e4c3..88d2ae526961 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -58,7 +58,7 @@ struct fib_rules_ops {
58 struct sk_buff *, 58 struct sk_buff *,
59 struct fib_rule_hdr *, 59 struct fib_rule_hdr *,
60 struct nlattr **); 60 struct nlattr **);
61 void (*delete)(struct fib_rule *); 61 int (*delete)(struct fib_rule *);
62 int (*compare)(struct fib_rule *, 62 int (*compare)(struct fib_rule *,
63 struct fib_rule_hdr *, 63 struct fib_rule_hdr *,
64 struct nlattr **); 64 struct nlattr **);
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 1657604c5dd3..54271ed0ed45 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -186,7 +186,8 @@ struct fib_table {
186 int tb_default; 186 int tb_default;
187 int tb_num_default; 187 int tb_num_default;
188 struct rcu_head rcu; 188 struct rcu_head rcu;
189 unsigned long tb_data[0]; 189 unsigned long *tb_data;
190 unsigned long __data[0];
190}; 191};
191 192
192int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, 193int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
@@ -196,11 +197,10 @@ int fib_table_delete(struct fib_table *, struct fib_config *);
196int fib_table_dump(struct fib_table *table, struct sk_buff *skb, 197int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
197 struct netlink_callback *cb); 198 struct netlink_callback *cb);
198int fib_table_flush(struct fib_table *table); 199int fib_table_flush(struct fib_table *table);
200struct fib_table *fib_trie_unmerge(struct fib_table *main_tb);
199void fib_table_flush_external(struct fib_table *table); 201void fib_table_flush_external(struct fib_table *table);
200void fib_free_table(struct fib_table *tb); 202void fib_free_table(struct fib_table *tb);
201 203
202
203
204#ifndef CONFIG_IP_MULTIPLE_TABLES 204#ifndef CONFIG_IP_MULTIPLE_TABLES
205 205
206#define TABLE_LOCAL_INDEX (RT_TABLE_LOCAL & (FIB_TABLE_HASHSZ - 1)) 206#define TABLE_LOCAL_INDEX (RT_TABLE_LOCAL & (FIB_TABLE_HASHSZ - 1))
@@ -229,18 +229,13 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
229 struct fib_result *res) 229 struct fib_result *res)
230{ 230{
231 struct fib_table *tb; 231 struct fib_table *tb;
232 int err; 232 int err = -ENETUNREACH;
233 233
234 rcu_read_lock(); 234 rcu_read_lock();
235 235
236 for (err = 0; !err; err = -ENETUNREACH) { 236 tb = fib_get_table(net, RT_TABLE_MAIN);
237 tb = fib_get_table(net, RT_TABLE_LOCAL); 237 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF))
238 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF)) 238 err = 0;
239 break;
240 tb = fib_get_table(net, RT_TABLE_MAIN);
241 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF))
242 break;
243 }
244 239
245 rcu_read_unlock(); 240 rcu_read_unlock();
246 241
@@ -270,10 +265,6 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
270 res->tclassid = 0; 265 res->tclassid = 0;
271 266
272 for (err = 0; !err; err = -ENETUNREACH) { 267 for (err = 0; !err; err = -ENETUNREACH) {
273 tb = rcu_dereference_rtnl(net->ipv4.fib_local);
274 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF))
275 break;
276
277 tb = rcu_dereference_rtnl(net->ipv4.fib_main); 268 tb = rcu_dereference_rtnl(net->ipv4.fib_main);
278 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF)) 269 if (tb && !fib_table_lookup(tb, flp, res, FIB_LOOKUP_NOREF))
279 break; 270 break;
@@ -309,6 +300,7 @@ static inline int fib_num_tclassid_users(struct net *net)
309 return 0; 300 return 0;
310} 301}
311#endif 302#endif
303int fib_unmerge(struct net *net);
312void fib_flush_external(struct net *net); 304void fib_flush_external(struct net *net);
313 305
314/* Exported by fib_semantics.c */ 306/* Exported by fib_semantics.c */
@@ -320,7 +312,7 @@ void fib_select_multipath(struct fib_result *res);
320 312
321/* Exported by fib_trie.c */ 313/* Exported by fib_trie.c */
322void fib_trie_init(void); 314void fib_trie_init(void);
323struct fib_table *fib_trie_table(u32 id); 315struct fib_table *fib_trie_table(u32 id, struct fib_table *alias);
324 316
325static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) 317static inline void fib_combine_itag(u32 *itag, const struct fib_result *res)
326{ 318{