aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6mr.c
diff options
context:
space:
mode:
authorYuval Mintz <yuvalm@mellanox.com>2018-03-26 15:01:35 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-26 13:14:43 -0400
commitd3c07e5b9939a055fa017f200e535ae947eb22ab (patch)
tree5b724c9f394cc481ca6ec60fd29b1abae8aaa6f2 /net/ipv6/ip6mr.c
parentip6mr: Support fib notifications (diff)
downloadlinux-dev-d3c07e5b9939a055fa017f200e535ae947eb22ab.tar.xz
linux-dev-d3c07e5b9939a055fa017f200e535ae947eb22ab.zip
ip6mr: Add API for default_rule fib
Add the ability to discern whether a given FIB rule notification relates to the default rule inserted when registering ip6mr or a different one. Would later be used by drivers wishing to offload ipv6 multicast routes but unable to offload rules other than the default one. Signed-off-by: Yuval Mintz <yuvalm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r--net/ipv6/ip6mr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 0be2f333e168..a187c523a95f 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -268,6 +268,13 @@ static unsigned int ip6mr_rules_seq_read(struct net *net)
{
return fib_rules_seq_read(net, RTNL_FAMILY_IP6MR);
}
+
+bool ip6mr_rule_default(const struct fib_rule *rule)
+{
+ return fib_rule_matchall(rule) && rule->action == FR_ACT_TO_TBL &&
+ rule->table == RT6_TABLE_DFLT && !rule->l3mdev;
+}
+EXPORT_SYMBOL(ip6mr_rule_default);
#else
#define ip6mr_for_each_table(mrt, net) \
for (mrt = net->ipv6.mrt6; mrt; mrt = NULL)