Lines Matching full:net

3  * net/ipv6/fib6_rules.c	IPv6 Routing Policy Rules
18 #include <net/fib_rules.h>
19 #include <net/inet_dscp.h>
20 #include <net/ipv6.h>
21 #include <net/addrconf.h>
22 #include <net/ip6_route.h>
23 #include <net/netlink.h>
52 int fib6_rules_dump(struct net *net, struct notifier_block *nb, in fib6_rules_dump() argument
55 return fib_rules_dump(net, nb, AF_INET6, extack); in fib6_rules_dump()
58 unsigned int fib6_rules_seq_read(struct net *net) in fib6_rules_seq_read() argument
60 return fib_rules_seq_read(net, AF_INET6); in fib6_rules_seq_read()
64 int fib6_lookup(struct net *net, int oif, struct flowi6 *fl6, in fib6_lookup() argument
69 if (net->ipv6.fib6_has_custom_rules) { in fib6_lookup()
77 l3mdev_update_flow(net, flowi6_to_flowi(fl6)); in fib6_lookup()
79 err = fib_rules_lookup(net->ipv6.fib6_rules_ops, in fib6_lookup()
82 err = fib6_table_lookup(net, net->ipv6.fib6_local_tbl, oif, in fib6_lookup()
84 if (err || res->f6i == net->ipv6.fib6_null_entry) in fib6_lookup()
85 err = fib6_table_lookup(net, net->ipv6.fib6_main_tbl, in fib6_lookup()
92 struct dst_entry *fib6_rule_lookup(struct net *net, struct flowi6 *fl6, in fib6_rule_lookup() argument
96 if (net->ipv6.fib6_has_custom_rules) { in fib6_rule_lookup()
106 l3mdev_update_flow(net, flowi6_to_flowi(fl6)); in fib6_rule_lookup()
108 fib_rules_lookup(net->ipv6.fib6_rules_ops, in fib6_rule_lookup()
117 net, net->ipv6.fib6_local_tbl, fl6, skb, flags); in fib6_rule_lookup()
118 if (rt != net->ipv6.ip6_null_entry && rt->dst.error != -EAGAIN) in fib6_rule_lookup()
122 net, net->ipv6.fib6_main_tbl, fl6, skb, flags); in fib6_rule_lookup()
129 dst_hold(&net->ipv6.ip6_null_entry->dst); in fib6_rule_lookup()
130 return &net->ipv6.ip6_null_entry->dst; in fib6_rule_lookup()
133 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags, in fib6_rule_saddr() argument
145 if (ipv6_dev_get_saddr(net, dev, &flp6->daddr, in fib6_rule_saddr()
163 struct net *net = rule->fr_net; in fib6_rule_action_alt() local
181 table = fib6_get_table(net, tb_id); in fib6_rule_action_alt()
186 err = fib6_table_lookup(net, table, *oif, flp6, res, flags); in fib6_rule_action_alt()
187 if (!err && res->f6i != net->ipv6.fib6_null_entry) in fib6_rule_action_alt()
188 err = fib6_rule_saddr(net, rule, flags, flp6, in fib6_rule_action_alt()
203 struct net *net = rule->fr_net; in __fib6_rule_action() local
213 rt = net->ipv6.ip6_null_entry; in __fib6_rule_action()
218 rt = net->ipv6.ip6_blk_hole_entry; in __fib6_rule_action()
222 rt = net->ipv6.ip6_prohibit_entry; in __fib6_rule_action()
227 table = fib6_get_table(net, tb_id); in __fib6_rule_action()
234 net, table, flp6, arg->lookup_data, flags); in __fib6_rule_action()
235 if (rt != net->ipv6.ip6_null_entry) { in __fib6_rule_action()
236 err = fib6_rule_saddr(net, rule, flags, flp6, in __fib6_rule_action()
350 struct net *net = sock_net(skb->sk); in fib6_rule_configure() local
366 if (fib6_new_table(net, rule->table) == NULL) { in fib6_rule_configure()
382 net->ipv6.fib6_rules_require_fldissect++; in fib6_rule_configure()
384 net->ipv6.fib6_has_custom_rules = true; in fib6_rule_configure()
392 struct net *net = rule->fr_net; in fib6_rule_delete() local
394 if (net->ipv6.fib6_rules_require_fldissect && in fib6_rule_delete()
396 net->ipv6.fib6_rules_require_fldissect--; in fib6_rule_delete()
469 static int __net_init fib6_rules_net_init(struct net *net) in fib6_rules_net_init() argument
474 ops = fib_rules_register(&fib6_rules_ops_template, net); in fib6_rules_net_init()
486 net->ipv6.fib6_rules_ops = ops; in fib6_rules_net_init()
487 net->ipv6.fib6_rules_require_fldissect = 0; in fib6_rules_net_init()
498 struct net *net; in fib6_rules_net_exit_batch() local
501 list_for_each_entry(net, net_list, exit_list) { in fib6_rules_net_exit_batch()
502 fib_rules_unregister(net->ipv6.fib6_rules_ops); in fib6_rules_net_exit_batch()