diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_fib.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 5408b64f3b5f..19ee7375daa9 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -829,6 +829,9 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root, | |||
829 | struct fib6_node *fn; | 829 | struct fib6_node *fn; |
830 | int dir; | 830 | int dir; |
831 | 831 | ||
832 | if (unlikely(args->offset == 0)) | ||
833 | return NULL; | ||
834 | |||
832 | /* | 835 | /* |
833 | * Descend on a tree | 836 | * Descend on a tree |
834 | */ | 837 | */ |
@@ -879,16 +882,22 @@ static struct fib6_node * fib6_lookup_1(struct fib6_node *root, | |||
879 | struct fib6_node * fib6_lookup(struct fib6_node *root, struct in6_addr *daddr, | 882 | struct fib6_node * fib6_lookup(struct fib6_node *root, struct in6_addr *daddr, |
880 | struct in6_addr *saddr) | 883 | struct in6_addr *saddr) |
881 | { | 884 | { |
882 | struct lookup_args args[2]; | ||
883 | struct fib6_node *fn; | 885 | struct fib6_node *fn; |
884 | 886 | struct lookup_args args[] = { | |
885 | args[0].offset = offsetof(struct rt6_info, rt6i_dst); | 887 | { |
886 | args[0].addr = daddr; | 888 | .offset = offsetof(struct rt6_info, rt6i_dst), |
887 | 889 | .addr = daddr, | |
890 | }, | ||
888 | #ifdef CONFIG_IPV6_SUBTREES | 891 | #ifdef CONFIG_IPV6_SUBTREES |
889 | args[1].offset = offsetof(struct rt6_info, rt6i_src); | 892 | { |
890 | args[1].addr = saddr; | 893 | .offset = offsetof(struct rt6_info, rt6i_src), |
894 | .addr = saddr, | ||
895 | }, | ||
891 | #endif | 896 | #endif |
897 | { | ||
898 | .offset = 0, /* sentinel */ | ||
899 | } | ||
900 | }; | ||
892 | 901 | ||
893 | fn = fib6_lookup_1(root, args); | 902 | fn = fib6_lookup_1(root, args); |
894 | 903 | ||