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/ipv4/ipmr.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/ipv4/ipmr.c')
-rw-r--r-- | net/ipv4/ipmr.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 58e4160fdcee..0c452e3fdc1b 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -65,6 +65,7 @@ | |||
65 | #include <net/checksum.h> | 65 | #include <net/checksum.h> |
66 | #include <net/netlink.h> | 66 | #include <net/netlink.h> |
67 | #include <net/fib_rules.h> | 67 | #include <net/fib_rules.h> |
68 | #include <linux/netconf.h> | ||
68 | 69 | ||
69 | #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) | 70 | #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) |
70 | #define CONFIG_IP_PIMSM 1 | 71 | #define CONFIG_IP_PIMSM 1 |
@@ -582,6 +583,9 @@ static int vif_delete(struct mr_table *mrt, int vifi, int notify, | |||
582 | in_dev = __in_dev_get_rtnl(dev); | 583 | in_dev = __in_dev_get_rtnl(dev); |
583 | if (in_dev) { | 584 | if (in_dev) { |
584 | IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)--; | 585 | IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)--; |
586 | inet_netconf_notify_devconf(dev_net(dev), | ||
587 | NETCONFA_MC_FORWARDING, | ||
588 | dev->ifindex, &in_dev->cnf); | ||
585 | ip_rt_multicast_event(in_dev); | 589 | ip_rt_multicast_event(in_dev); |
586 | } | 590 | } |
587 | 591 | ||
@@ -772,6 +776,8 @@ static int vif_add(struct net *net, struct mr_table *mrt, | |||
772 | return -EADDRNOTAVAIL; | 776 | return -EADDRNOTAVAIL; |
773 | } | 777 | } |
774 | IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++; | 778 | IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++; |
779 | inet_netconf_notify_devconf(net, NETCONFA_MC_FORWARDING, dev->ifindex, | ||
780 | &in_dev->cnf); | ||
775 | ip_rt_multicast_event(in_dev); | 781 | ip_rt_multicast_event(in_dev); |
776 | 782 | ||
777 | /* Fill in the VIF structures */ | 783 | /* Fill in the VIF structures */ |
@@ -1185,6 +1191,9 @@ static void mrtsock_destruct(struct sock *sk) | |||
1185 | ipmr_for_each_table(mrt, net) { | 1191 | ipmr_for_each_table(mrt, net) { |
1186 | if (sk == rtnl_dereference(mrt->mroute_sk)) { | 1192 | if (sk == rtnl_dereference(mrt->mroute_sk)) { |
1187 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)--; | 1193 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)--; |
1194 | inet_netconf_notify_devconf(net, NETCONFA_MC_FORWARDING, | ||
1195 | NETCONFA_IFINDEX_ALL, | ||
1196 | net->ipv4.devconf_all); | ||
1188 | RCU_INIT_POINTER(mrt->mroute_sk, NULL); | 1197 | RCU_INIT_POINTER(mrt->mroute_sk, NULL); |
1189 | mroute_clean_tables(mrt); | 1198 | mroute_clean_tables(mrt); |
1190 | } | 1199 | } |
@@ -1236,6 +1245,9 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi | |||
1236 | if (ret == 0) { | 1245 | if (ret == 0) { |
1237 | rcu_assign_pointer(mrt->mroute_sk, sk); | 1246 | rcu_assign_pointer(mrt->mroute_sk, sk); |
1238 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; | 1247 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; |
1248 | inet_netconf_notify_devconf(net, NETCONFA_MC_FORWARDING, | ||
1249 | NETCONFA_IFINDEX_ALL, | ||
1250 | net->ipv4.devconf_all); | ||
1239 | } | 1251 | } |
1240 | rtnl_unlock(); | 1252 | rtnl_unlock(); |
1241 | return ret; | 1253 | return ret; |