Skip to content

Commit

Permalink
[IPV6]: Make sure fib6_rule_lookup doesn't return NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ville Nuorvala authored and David S. Miller committed Sep 22, 2006
1 parent 99a92ff commit b142955
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/ipv6/fib6_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b142955

Please sign in to comment.