summaryrefslogtreecommitdiffstats
path: root/net/ipv6/fib6_rules.c
diff options
context:
space:
mode:
authorVille Nuorvala2006-08-09 01:44:17 +0200
committerDavid S. Miller2006-09-22 23:54:12 +0200
commitb14295532421c40f82ee099fdbd3d011f022e756 (patch)
tree5b08b1c3ef0a33952db11c484fb0e2c69190aac6 /net/ipv6/fib6_rules.c
parent[IPV4]: Uninline inet_lookup_listener (diff)
downloadkernel-qcow2-linux-b14295532421c40f82ee099fdbd3d011f022e756.tar.gz
kernel-qcow2-linux-b14295532421c40f82ee099fdbd3d011f022e756.tar.xz
kernel-qcow2-linux-b14295532421c40f82ee099fdbd3d011f022e756.zip
[IPV6]: Make sure fib6_rule_lookup doesn't return NULL
The callers of fib6_rule_lookup don't expect it to return NULL, therefore it must return ip6_null_entry whenever fib_rule_lookup fails. Signed-off-by: Ville Nuorvala <vnuorval@tcs.hut.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r--net/ipv6/fib6_rules.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index bf9bba83b852..22a2fdb09831 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -63,7 +63,11 @@ struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags,
if (arg.rule)
fib_rule_put(arg.rule);
- return (struct dst_entry *) arg.result;
+ if (arg.result)
+ return (struct dst_entry *) arg.result;
+
+ dst_hold(&ip6_null_entry.u.dst);
+ return &ip6_null_entry.u.dst;
}
static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,