16 #include <linux/netdevice.h>
17 #include <linux/export.h>
41 flowi6_to_flowi(fl6), flags, &arg);
46 dst_hold(&net->ipv6.ip6_null_entry->dst);
47 return &net->ipv6.ip6_null_entry->dst;
63 rt = net->ipv6.ip6_null_entry;
67 rt = net->ipv6.ip6_blk_hole_entry;
70 rt = net->ipv6.ip6_prohibit_entry;
76 rt =
lookup(net, table, flp6, flags);
78 if (rt != net->ipv6.ip6_null_entry) {
90 ip6_dst_idev(&rt->
dst)->dev,
92 rt6_flags2srcprefs(flags),
95 if (!ipv6_prefix_equal(&
saddr, &r->
src.addr,
115 static int fib6_rule_match(
struct fib_rule *rule,
struct flowi *
fl,
int flags)
121 !ipv6_prefix_equal(&fl6->
daddr, &r->
dst.addr, r->
dst.plen))
131 if (!ipv6_prefix_equal(&fl6->
saddr, &r->
src.addr,
153 struct net *net = sock_net(skb->
sk);
217 if ((rule6->
dst.plen &&
219 &rule6->
dst.addr)) ||
223 goto nla_put_failure;
235 static size_t fib6_rule_nlmsg_payload(
struct fib_rule *rule)
237 return nla_total_size(16)
238 + nla_total_size(16);
245 .
action = fib6_rule_action,
246 .match = fib6_rule_match,
247 .configure = fib6_rule_configure,
248 .compare = fib6_rule_compare,
249 .fill = fib6_rule_fill,
250 .default_pref = fib6_rule_default_pref,
251 .nlmsg_payload = fib6_rule_nlmsg_payload,
253 .policy = fib6_rule_policy,
258 static int __net_init fib6_rules_net_init(
struct net *net)
266 net->ipv6.fib6_rules_ops = ops;
272 goto out_fib6_rules_ops;
277 goto out_fib6_rules_ops;
287 static void __net_exit fib6_rules_net_exit(
struct net *net)
293 .init = fib6_rules_net_init,
294 .exit = fib6_rules_net_exit,