aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorTom Goff <thomas.goff@boeing.com>2009-06-14 06:16:13 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-14 06:16:13 -0400
commit403dbb97f654cd59b87999fe1b64d29bf90b3a2a (patch)
treec8d4ea1152288792f5e6bde54e79497dcfd44a9e /net/ipv6
parente61a4b634a15c11725eac8e66b457ba411168c7f (diff)
PIM-SM: namespace changes
IPv4: - make PIM register vifs netns local - set the netns when a PIM register vif is created - make PIM available in all network namespaces (if CONFIG_IP_PIMSM_V2) by adding the protocol handler when multicast routing is initialized IPv6: - make PIM register vifs netns local - make PIM available in all network namespaces (if CONFIG_IPV6_PIMSM_V2) by adding the protocol handler when multicast routing is initialized Signed-off-by: Tom Goff <thomas.goff@boeing.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6mr.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index a35d8fc55b04..c769f155c698 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -441,6 +441,7 @@ static void reg_vif_setup(struct net_device *dev)
441 dev->flags = IFF_NOARP; 441 dev->flags = IFF_NOARP;
442 dev->netdev_ops = &reg_vif_netdev_ops; 442 dev->netdev_ops = &reg_vif_netdev_ops;
443 dev->destructor = free_netdev; 443 dev->destructor = free_netdev;
444 dev->features |= NETIF_F_NETNS_LOCAL;
444} 445}
445 446
446static struct net_device *ip6mr_reg_vif(struct net *net) 447static struct net_device *ip6mr_reg_vif(struct net *net)
@@ -1077,7 +1078,18 @@ int __init ip6_mr_init(void)
1077 err = register_netdevice_notifier(&ip6_mr_notifier); 1078 err = register_netdevice_notifier(&ip6_mr_notifier);
1078 if (err) 1079 if (err)
1079 goto reg_notif_fail; 1080 goto reg_notif_fail;
1081#ifdef CONFIG_IPV6_PIMSM_V2
1082 if (inet6_add_protocol(&pim6_protocol, IPPROTO_PIM) < 0) {
1083 printk(KERN_ERR "ip6_mr_init: can't add PIM protocol\n");
1084 err = -EAGAIN;
1085 goto add_proto_fail;
1086 }
1087#endif
1080 return 0; 1088 return 0;
1089#ifdef CONFIG_IPV6_PIMSM_V2
1090add_proto_fail:
1091 unregister_netdevice_notifier(&ip6_mr_notifier);
1092#endif
1081reg_notif_fail: 1093reg_notif_fail:
1082 del_timer(&ipmr_expire_timer); 1094 del_timer(&ipmr_expire_timer);
1083 unregister_pernet_subsys(&ip6mr_net_ops); 1095 unregister_pernet_subsys(&ip6mr_net_ops);
@@ -1363,14 +1375,6 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, int
1363 if (v != net->ipv6.mroute_do_pim) { 1375 if (v != net->ipv6.mroute_do_pim) {
1364 net->ipv6.mroute_do_pim = v; 1376 net->ipv6.mroute_do_pim = v;
1365 net->ipv6.mroute_do_assert = v; 1377 net->ipv6.mroute_do_assert = v;
1366 if (net->ipv6.mroute_do_pim)
1367 ret = inet6_add_protocol(&pim6_protocol,
1368 IPPROTO_PIM);
1369 else
1370 ret = inet6_del_protocol(&pim6_protocol,
1371 IPPROTO_PIM);
1372 if (ret < 0)
1373 ret = -EAGAIN;
1374 } 1378 }
1375 rtnl_unlock(); 1379 rtnl_unlock();
1376 return ret; 1380 return ret;