Lines Matching refs:net

56 int fib6_rules_dump(struct net *net, struct notifier_block *nb,  in fib6_rules_dump()  argument
59 return fib_rules_dump(net, nb, AF_INET6, extack); in fib6_rules_dump()
62 unsigned int fib6_rules_seq_read(const struct net *net) in fib6_rules_seq_read() argument
64 return fib_rules_seq_read(net, AF_INET6); in fib6_rules_seq_read()
68 int fib6_lookup(struct net *net, int oif, struct flowi6 *fl6, in fib6_lookup() argument
73 if (net->ipv6.fib6_has_custom_rules) { in fib6_lookup()
81 l3mdev_update_flow(net, flowi6_to_flowi(fl6)); in fib6_lookup()
83 err = fib_rules_lookup(net->ipv6.fib6_rules_ops, in fib6_lookup()
86 err = fib6_table_lookup(net, net->ipv6.fib6_local_tbl, oif, in fib6_lookup()
88 if (err || res->f6i == net->ipv6.fib6_null_entry) in fib6_lookup()
89 err = fib6_table_lookup(net, net->ipv6.fib6_main_tbl, in fib6_lookup()
96 struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6, in fib6_rule_lookup() argument
100 if (net->ipv6.fib6_has_custom_rules) { in fib6_rule_lookup()
110 l3mdev_update_flow(net, flowi6_to_flowi(fl6)); in fib6_rule_lookup()
112 fib_rules_lookup(net->ipv6.fib6_rules_ops, in fib6_rule_lookup()
121 net, net->ipv6.fib6_local_tbl, fl6, skb, flags); in fib6_rule_lookup()
122 if (rt != net->ipv6.ip6_null_entry && rt->dst.error != -EAGAIN) in fib6_rule_lookup()
126 net, net->ipv6.fib6_main_tbl, fl6, skb, flags); in fib6_rule_lookup()
133 dst_hold(&net->ipv6.ip6_null_entry->dst); in fib6_rule_lookup()
134 return &net->ipv6.ip6_null_entry->dst; in fib6_rule_lookup()
137 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags, in fib6_rule_saddr() argument
149 if (ipv6_dev_get_saddr(net, dev, &flp6->daddr, in fib6_rule_saddr()
167 struct net *net = rule->fr_net; in fib6_rule_action_alt() local
185 table = fib6_get_table(net, tb_id); in fib6_rule_action_alt()
190 err = fib6_table_lookup(net, table, *oif, flp6, res, flags); in fib6_rule_action_alt()
191 if (!err && res->f6i != net->ipv6.fib6_null_entry) in fib6_rule_action_alt()
192 err = fib6_rule_saddr(net, rule, flags, flp6, in fib6_rule_action_alt()
207 struct net *net = rule->fr_net; in __fib6_rule_action() local
217 rt = net->ipv6.ip6_null_entry; in __fib6_rule_action()
222 rt = net->ipv6.ip6_blk_hole_entry; in __fib6_rule_action()
226 rt = net->ipv6.ip6_prohibit_entry; in __fib6_rule_action()
231 table = fib6_get_table(net, tb_id); in __fib6_rule_action()
238 net, table, flp6, arg->lookup_data, flags); in __fib6_rule_action()
239 if (rt != net->ipv6.ip6_null_entry) { in __fib6_rule_action()
244 err = fib6_rule_saddr(net, rule, flags, flp6, in __fib6_rule_action()
428 struct net *net = rule->fr_net; in fib6_rule_configure() local
456 if (fib6_new_table(net, rule->table) == NULL) { in fib6_rule_configure()
472 net->ipv6.fib6_rules_require_fldissect++; in fib6_rule_configure()
474 net->ipv6.fib6_has_custom_rules = true; in fib6_rule_configure()
482 struct net *net = rule->fr_net; in fib6_rule_delete() local
484 if (net->ipv6.fib6_rules_require_fldissect && in fib6_rule_delete()
486 net->ipv6.fib6_rules_require_fldissect--; in fib6_rule_delete()
610 static int __net_init fib6_rules_net_init(struct net *net) in fib6_rules_net_init() argument
615 ops = fib_rules_register(&fib6_rules_ops_template, net); in fib6_rules_net_init()
627 net->ipv6.fib6_rules_ops = ops; in fib6_rules_net_init()
628 net->ipv6.fib6_rules_require_fldissect = 0; in fib6_rules_net_init()
639 struct net *net; in fib6_rules_net_exit_batch() local
642 list_for_each_entry(net, net_list, exit_list) { in fib6_rules_net_exit_batch()
643 fib_rules_unregister(net->ipv6.fib6_rules_ops); in fib6_rules_net_exit_batch()