diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-31 19:10:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-31 19:10:03 -0500 |
commit | 5b4704419cbd0b7597a91c19f9e8e8b17c1af071 (patch) | |
tree | 94ee46905ba2a142bdf910fb26f7450c41ebc46a /net/ipv4/fib_semantics.c | |
parent | a5e3c2aae23a3719105c1ae662c67ef282f213db (diff) |
ipv4: Remember FIB alias list head and table in lookup results.
This will be used later to implement fib_select_default() in a
completely generic manner, instead of the current situation where the
default route is re-looked up in the TRIE/HASH table and then the
available aliases are analyzed.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 48e93a560077..1bf6fb906cfc 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -889,8 +889,9 @@ failure: | |||
889 | } | 889 | } |
890 | 890 | ||
891 | /* Note! fib_semantic_match intentionally uses RCU list functions. */ | 891 | /* Note! fib_semantic_match intentionally uses RCU list functions. */ |
892 | int fib_semantic_match(struct list_head *head, const struct flowi *flp, | 892 | int fib_semantic_match(struct fib_table *tb, struct list_head *head, |
893 | struct fib_result *res, int prefixlen, int fib_flags) | 893 | const struct flowi *flp, struct fib_result *res, |
894 | int prefixlen, int fib_flags) | ||
894 | { | 895 | { |
895 | struct fib_alias *fa; | 896 | struct fib_alias *fa; |
896 | int nh_sel = 0; | 897 | int nh_sel = 0; |
@@ -954,6 +955,8 @@ out_fill_res: | |||
954 | res->type = fa->fa_type; | 955 | res->type = fa->fa_type; |
955 | res->scope = fa->fa_scope; | 956 | res->scope = fa->fa_scope; |
956 | res->fi = fa->fa_info; | 957 | res->fi = fa->fa_info; |
958 | res->table = tb; | ||
959 | res->fa_head = head; | ||
957 | if (!(fib_flags & FIB_LOOKUP_NOREF)) | 960 | if (!(fib_flags & FIB_LOOKUP_NOREF)) |
958 | atomic_inc(&res->fi->fib_clntref); | 961 | atomic_inc(&res->fi->fib_clntref); |
959 | return 0; | 962 | return 0; |