16 #include <linux/capability.h>
17 #include <linux/module.h>
18 #include <linux/errno.h>
19 #include <linux/types.h>
20 #include <linux/random.h>
21 #include <linux/string.h>
22 #include <linux/socket.h>
24 #include <linux/net.h>
25 #include <linux/in6.h>
26 #include <linux/netdevice.h>
27 #include <linux/if_arp.h>
32 #include <linux/slab.h>
63 struct net *
net = sock_net(sk);
64 int ishost = !net->ipv6.devconf_all->forwarding;
69 if (ipv6_addr_is_multicast(addr))
104 idev = __in6_dev_get(dev);
113 ishost = !idev->
cnf.forwarding;
153 struct net *
net = sock_net(sk);
158 if ((ifindex == 0 || pac->
acl_ifindex == ifindex) &&
159 ipv6_addr_equal(&pac->
acl_addr, addr))
177 ipv6_dev_ac_dec(dev, &pac->
acl_addr);
189 struct net *
net = sock_net(sk);
207 ipv6_dev_ac_dec(dev, &pac->
acl_addr);
233 idev = in6_dev_get(dev);
245 if (ipv6_addr_equal(&aca->
aca_addr, addr)) {
305 if (ipv6_addr_equal(&aca->
aca_addr, addr))
324 dst_hold(&aca->
aca_rt->dst);
350 idev = __in6_dev_get(dev);
354 if (ipv6_addr_equal(&aca->
aca_addr, addr))
372 found = ipv6_chk_acast_dev(dev, addr);
375 if (ipv6_chk_acast_dev(dev, addr)) {
384 #ifdef CONFIG_PROC_FS
385 struct ac6_iter_state {
391 #define ac6_seq_private(seq) ((struct ac6_iter_state *)(seq)->private)
396 struct ac6_iter_state *
state = ac6_seq_private(seq);
397 struct net *
net = seq_file_net(seq);
402 idev = __in6_dev_get(state->dev);
418 struct ac6_iter_state *state = ac6_seq_private(seq);
425 state->dev = next_net_device_rcu(state->dev);
430 state->idev = __in6_dev_get(state->dev);
434 im = state->idev->ac_list;
441 struct ifacaddr6 *im = ac6_get_first(seq);
443 while (pos && (im = ac6_get_next(seq, im)) !=
NULL)
445 return pos ?
NULL : im;
448 static void *ac6_seq_start(
struct seq_file *seq, loff_t *pos)
452 return ac6_get_idx(seq, *pos);
455 static void *ac6_seq_next(
struct seq_file *seq,
void *
v, loff_t *pos)
457 struct ifacaddr6 *im = ac6_get_next(seq, v);
463 static void ac6_seq_stop(
struct seq_file *seq,
void *
v)
466 struct ac6_iter_state *state = ac6_seq_private(seq);
475 static int ac6_seq_show(
struct seq_file *seq,
void *
v)
478 struct ac6_iter_state *state = ac6_seq_private(seq);
481 state->dev->ifindex, state->dev->name,
487 .
start = ac6_seq_start,
488 .next = ac6_seq_next,
489 .stop = ac6_seq_stop,
490 .show = ac6_seq_show,
496 sizeof(
struct ac6_iter_state));
501 .open = ac6_seq_open,
515 void ac6_proc_exit(
struct net *net)