diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-08-04 06:39:02 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:53:41 -0400 |
commit | 101367c2f8c464ea96643192673aa18d88e6336d (patch) | |
tree | bf129373fb6f9e168671f42bf597e5564cdfbd42 /net/ipv6/ip6_fib.c | |
parent | 14c0b97ddfc2944982d078b8e33b088840068976 (diff) |
[IPV6]: Policy Routing Rules
Adds support for policy routing rules including a new
local table for routes with a local destination.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r-- | net/ipv6/ip6_fib.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index fcd7da830aca..ce226c14bef5 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -159,6 +159,15 @@ static struct fib6_table fib6_main_tbl = { | |||
159 | 159 | ||
160 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 160 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
161 | 161 | ||
162 | static struct fib6_table fib6_local_tbl = { | ||
163 | .tb6_id = RT6_TABLE_LOCAL, | ||
164 | .tb6_lock = RW_LOCK_UNLOCKED, | ||
165 | .tb6_root = { | ||
166 | .leaf = &ip6_null_entry, | ||
167 | .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, | ||
168 | }, | ||
169 | }; | ||
170 | |||
162 | #define FIB_TABLE_HASHSZ 256 | 171 | #define FIB_TABLE_HASHSZ 256 |
163 | static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; | 172 | static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; |
164 | 173 | ||
@@ -228,20 +237,10 @@ struct fib6_table *fib6_get_table(u32 id) | |||
228 | return NULL; | 237 | return NULL; |
229 | } | 238 | } |
230 | 239 | ||
231 | struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags, | ||
232 | pol_lookup_t lookup) | ||
233 | { | ||
234 | /* | ||
235 | * TODO: Add rule lookup | ||
236 | */ | ||
237 | struct fib6_table *table = fib6_get_table(RT6_TABLE_MAIN); | ||
238 | |||
239 | return (struct dst_entry *) lookup(table, fl, flags); | ||
240 | } | ||
241 | |||
242 | static void __init fib6_tables_init(void) | 240 | static void __init fib6_tables_init(void) |
243 | { | 241 | { |
244 | fib6_link_table(&fib6_main_tbl); | 242 | fib6_link_table(&fib6_main_tbl); |
243 | fib6_link_table(&fib6_local_tbl); | ||
245 | } | 244 | } |
246 | 245 | ||
247 | #else | 246 | #else |