aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_fib.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-31 19:16:50 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-31 19:16:50 -0500
commit0c838ff1ade71162775afffd9e5c6478a60bdca6 (patch)
tree81910cc5582f4862770307784c40c66aa3a44948 /include/net/ip_fib.h
parent5b4704419cbd0b7597a91c19f9e8e8b17c1af071 (diff)
ipv4: Consolidate all default route selection implementations.
Both fib_trie and fib_hash have a local implementation of fib_table_select_default(). This is completely unnecessary code duplication. Since we now remember the fib_table and the head of the fib alias list of the default route, we can implement one single generic version of this routine. Looking at the fib_hash implementation you may get the impression that it's possible for there to be multiple top-level routes in the table for the default route. The truth is, it isn't, the insert code will only allow one entry to exist in the zero prefix hash table, because all keys evaluate to zero and all keys in a hash table must be unique. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r--include/net/ip_fib.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index f5199b08ba53..819d61ca25cb 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -158,9 +158,6 @@ extern int fib_table_delete(struct fib_table *, struct fib_config *);
158extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, 158extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
159 struct netlink_callback *cb); 159 struct netlink_callback *cb);
160extern int fib_table_flush(struct fib_table *table); 160extern int fib_table_flush(struct fib_table *table);
161extern void fib_table_select_default(struct fib_table *table,
162 const struct flowi *flp,
163 struct fib_result *res);
164extern void fib_free_table(struct fib_table *tb); 161extern void fib_free_table(struct fib_table *tb);
165 162
166 163
@@ -221,8 +218,7 @@ extern void ip_fib_init(void);
221extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, 218extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
222 struct net_device *dev, __be32 *spec_dst, 219 struct net_device *dev, __be32 *spec_dst,
223 u32 *itag, u32 mark); 220 u32 *itag, u32 mark);
224extern void fib_select_default(struct net *net, const struct flowi *flp, 221extern void fib_select_default(struct fib_result *res);
225 struct fib_result *res);
226 222
227/* Exported by fib_semantics.c */ 223/* Exported by fib_semantics.c */
228extern int ip_fib_check_default(__be32 gw, struct net_device *dev); 224extern int ip_fib_check_default(__be32 gw, struct net_device *dev);