Skip to content

Commit

Permalink
ipv6: fib6_rule_action_alt needs to return -EAGAIN
Browse files Browse the repository at this point in the history
fib rule actions should return -EAGAIN for the rules to continue to the
next one. A recent change overwrote err with the lookup always returning
0 (future change will make it more like IPv4) which means the rules
stopped at the first (e.g., local table lookup only). Catch and reset err
to -EAGAIN.

Fixes: effda4d ("ipv6: Pass fib6_result to fib lookups")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
dsahern authored and davem330 committed Apr 24, 2019
1 parent 7973d9e commit b2f97f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/fib6_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp,
struct flowi6 *flp6 = &flp->u.ip6;
struct net *net = rule->fr_net;
struct fib6_table *table;
int err = -EAGAIN, *oif;
int err, *oif;
u32 tb_id;

switch (rule->action) {
Expand All @@ -182,6 +182,8 @@ static int fib6_rule_action_alt(struct fib_rule *rule, struct flowi *flp,
if (!err && res->f6i != net->ipv6.fib6_null_entry)
err = fib6_rule_saddr(net, rule, flags, flp6,
res->nh->fib_nh_dev);
else
err = -EAGAIN;

return err;
}
Expand Down

0 comments on commit b2f97f7

Please # to comment.