aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6mr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6mr.c')
-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;