Commit 41d707b7 authored by Brian Vazquez's avatar Brian Vazquez Committed by David S. Miller

fib: fix fib_rules_ops indirect calls wrappers

This patch fixes:
commit b9aaec8f ("fib: use indirect call wrappers in the most common
fib_rules_ops") which didn't consider the case when
CONFIG_IPV6_MULTIPLE_TABLES is not set.
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Fixes: b9aaec8f ("fib: use indirect call wrappers in the most common fib_rules_ops")
Signed-off-by: default avatarBrian Vazquez <brianvv@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a41cf09b
...@@ -16,6 +16,13 @@ ...@@ -16,6 +16,13 @@
#include <net/ip_tunnels.h> #include <net/ip_tunnels.h>
#include <linux/indirect_call_wrapper.h> #include <linux/indirect_call_wrapper.h>
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
#define INDIRECT_CALL_MT(f, f2, f1, ...) \
INDIRECT_CALL_INET(f, f2, f1, __VA_ARGS__)
#else
#define INDIRECT_CALL_MT(f, f2, f1, ...) INDIRECT_CALL_1(f, f1, __VA_ARGS__)
#endif
static const struct fib_kuid_range fib_kuid_range_unset = { static const struct fib_kuid_range fib_kuid_range_unset = {
KUIDT_INIT(0), KUIDT_INIT(0),
KUIDT_INIT(~0), KUIDT_INIT(~0),
...@@ -268,7 +275,7 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops, ...@@ -268,7 +275,7 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops,
uid_gt(fl->flowi_uid, rule->uid_range.end)) uid_gt(fl->flowi_uid, rule->uid_range.end))
goto out; goto out;
ret = INDIRECT_CALL_INET(ops->match, ret = INDIRECT_CALL_MT(ops->match,
fib6_rule_match, fib6_rule_match,
fib4_rule_match, fib4_rule_match,
rule, fl, flags); rule, fl, flags);
...@@ -302,12 +309,12 @@ int fib_rules_lookup(struct fib_rules_ops *ops, struct flowi *fl, ...@@ -302,12 +309,12 @@ int fib_rules_lookup(struct fib_rules_ops *ops, struct flowi *fl,
} else if (rule->action == FR_ACT_NOP) } else if (rule->action == FR_ACT_NOP)
continue; continue;
else else
err = INDIRECT_CALL_INET(ops->action, err = INDIRECT_CALL_MT(ops->action,
fib6_rule_action, fib6_rule_action,
fib4_rule_action, fib4_rule_action,
rule, fl, flags, arg); rule, fl, flags, arg);
if (!err && ops->suppress && INDIRECT_CALL_INET(ops->suppress, if (!err && ops->suppress && INDIRECT_CALL_MT(ops->suppress,
fib6_rule_suppress, fib6_rule_suppress,
fib4_rule_suppress, fib4_rule_suppress,
rule, arg)) rule, arg))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment