diff options
author | David S. Miller <davem@davemloft.net> | 2016-06-08 11:36:02 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-08 11:36:02 -0700 |
commit | 753c104becaf0893fe5760fb411a44006f6b558e (patch) | |
tree | d131da3350f06982ff304714bdb40415c1db3184 /net/ipv6 | |
parent | 6278e03dc667b611cc9ebbd8f455d859f18f8e11 (diff) | |
parent | 1aa6c4f6b8cd84b8b36ebf43c6861ca87eab4da0 (diff) | |
download | linux-753c104becaf0893fe5760fb411a44006f6b558e.tar.gz |
Merge branch 'vrf-fib-rule-improve'
David Ahern says:
====================
net: vrf: Improve use of FIB rules
Currently, VRFs require 1 oif and 1 iif rule per address family per
VRF. As the number of VRF devices increases it brings scalability
issues with the increasing rule list. All of the VRF rules have the
same format with the exception of the specific table id to direct the
lookup. Since the table id is available from the oif or iif in the
loopup, the VRF rules can be consolidated to a single rule that pulls
the table from the VRF device.
This solution still allows a user to insert their own rules for VRFs,
including rules with additional attributes. Accordingly, it is backwards
compatible with existing setups and allows other policy routing as
desired.
Hopefully v5 is the charm; my e-waste can is getting full.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/fib6_rules.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index ed33abf57abd..5857c1fc8b67 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c @@ -67,6 +67,7 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp, struct net *net = rule->fr_net; pol_lookup_t lookup = arg->lookup_ptr; int err = 0; + u32 tb_id; switch (rule->action) { case FR_ACT_TO_TBL: @@ -86,7 +87,8 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp, goto discard_pkt; } - table = fib6_get_table(net, rule->table); + tb_id = fib_rule_get_table(rule, arg); + table = fib6_get_table(net, tb_id); if (!table) { err = -EAGAIN; goto out; @@ -199,7 +201,7 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, struct net *net = sock_net(skb->sk); struct fib6_rule *rule6 = (struct fib6_rule *) rule; - if (rule->action == FR_ACT_TO_TBL) { + if (rule->action == FR_ACT_TO_TBL && !rule->l3mdev) { if (rule->table == RT6_TABLE_UNSPEC) goto errout; |