diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2012-12-03 20:13:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-04 13:08:10 -0500 |
commit | d67b8c616b48df30e2836d797795f2420d109bc9 (patch) | |
tree | e06b3f77e905e789def714958fcd455c8b3c037b /net/ipv6/ip6mr.c | |
parent | e8ad1a8fab6f550aba1f1fe7ba26749ff5460751 (diff) |
netconf: advertise mc_forwarding status
This patch advertise the MC_FORWARDING status for IPv4 and IPv6.
This field is readonly, only multicast engine in the kernel updates it.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6mr.c')
-rw-r--r-- | net/ipv6/ip6mr.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 926ea544f499..1c05fe604d37 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/netfilter_ipv6.h> | 52 | #include <linux/netfilter_ipv6.h> |
53 | #include <linux/export.h> | 53 | #include <linux/export.h> |
54 | #include <net/ip6_checksum.h> | 54 | #include <net/ip6_checksum.h> |
55 | #include <linux/netconf.h> | ||
55 | 56 | ||
56 | struct mr6_table { | 57 | struct mr6_table { |
57 | struct list_head list; | 58 | struct list_head list; |
@@ -805,8 +806,12 @@ static int mif6_delete(struct mr6_table *mrt, int vifi, struct list_head *head) | |||
805 | dev_set_allmulti(dev, -1); | 806 | dev_set_allmulti(dev, -1); |
806 | 807 | ||
807 | in6_dev = __in6_dev_get(dev); | 808 | in6_dev = __in6_dev_get(dev); |
808 | if (in6_dev) | 809 | if (in6_dev) { |
809 | in6_dev->cnf.mc_forwarding--; | 810 | in6_dev->cnf.mc_forwarding--; |
811 | inet6_netconf_notify_devconf(dev_net(dev), | ||
812 | NETCONFA_MC_FORWARDING, | ||
813 | dev->ifindex, &in6_dev->cnf); | ||
814 | } | ||
810 | 815 | ||
811 | if (v->flags & MIFF_REGISTER) | 816 | if (v->flags & MIFF_REGISTER) |
812 | unregister_netdevice_queue(dev, head); | 817 | unregister_netdevice_queue(dev, head); |
@@ -958,8 +963,12 @@ static int mif6_add(struct net *net, struct mr6_table *mrt, | |||
958 | } | 963 | } |
959 | 964 | ||
960 | in6_dev = __in6_dev_get(dev); | 965 | in6_dev = __in6_dev_get(dev); |
961 | if (in6_dev) | 966 | if (in6_dev) { |
962 | in6_dev->cnf.mc_forwarding++; | 967 | in6_dev->cnf.mc_forwarding++; |
968 | inet6_netconf_notify_devconf(dev_net(dev), | ||
969 | NETCONFA_MC_FORWARDING, | ||
970 | dev->ifindex, &in6_dev->cnf); | ||
971 | } | ||
963 | 972 | ||
964 | /* | 973 | /* |
965 | * Fill in the VIF structures | 974 | * Fill in the VIF structures |
@@ -1513,6 +1522,9 @@ static int ip6mr_sk_init(struct mr6_table *mrt, struct sock *sk) | |||
1513 | if (likely(mrt->mroute6_sk == NULL)) { | 1522 | if (likely(mrt->mroute6_sk == NULL)) { |
1514 | mrt->mroute6_sk = sk; | 1523 | mrt->mroute6_sk = sk; |
1515 | net->ipv6.devconf_all->mc_forwarding++; | 1524 | net->ipv6.devconf_all->mc_forwarding++; |
1525 | inet6_netconf_notify_devconf(net, NETCONFA_MC_FORWARDING, | ||
1526 | NETCONFA_IFINDEX_ALL, | ||
1527 | net->ipv6.devconf_all); | ||
1516 | } | 1528 | } |
1517 | else | 1529 | else |
1518 | err = -EADDRINUSE; | 1530 | err = -EADDRINUSE; |
@@ -1535,6 +1547,10 @@ int ip6mr_sk_done(struct sock *sk) | |||
1535 | write_lock_bh(&mrt_lock); | 1547 | write_lock_bh(&mrt_lock); |
1536 | mrt->mroute6_sk = NULL; | 1548 | mrt->mroute6_sk = NULL; |
1537 | net->ipv6.devconf_all->mc_forwarding--; | 1549 | net->ipv6.devconf_all->mc_forwarding--; |
1550 | inet6_netconf_notify_devconf(net, | ||
1551 | NETCONFA_MC_FORWARDING, | ||
1552 | NETCONFA_IFINDEX_ALL, | ||
1553 | net->ipv6.devconf_all); | ||
1538 | write_unlock_bh(&mrt_lock); | 1554 | write_unlock_bh(&mrt_lock); |
1539 | 1555 | ||
1540 | mroute_clean_tables(mrt); | 1556 | mroute_clean_tables(mrt); |