]> err.no Git - linux-2.6/blobdiff - net/ipv6/icmp.c
[IPV6]: Make ndisc_flow_init() common for later use.
[linux-2.6] / net / ipv6 / icmp.c
index 9f55a965c8847864dc33a7c8936257af31f23c11..cff74127ea3208eddfd6953f357515dc98fd883d 100644 (file)
@@ -777,6 +777,22 @@ drop_no_count:
        return 0;
 }
 
+void icmpv6_flow_init(struct sock *sk, struct flowi *fl,
+                     u8 type,
+                     const struct in6_addr *saddr,
+                     const struct in6_addr *daddr,
+                     int oif)
+{
+       memset(fl, 0, sizeof(*fl));
+       ipv6_addr_copy(&fl->fl6_src, saddr);
+       ipv6_addr_copy(&fl->fl6_dst, daddr);
+       fl->proto               = IPPROTO_ICMPV6;
+       fl->fl_icmp_type        = type;
+       fl->fl_icmp_code        = 0;
+       fl->oif                 = oif;
+       security_sk_classify_flow(sk, fl);
+}
+
 /*
  * Special lock-class for __icmpv6_sk:
  */
@@ -844,7 +860,7 @@ static void __net_exit icmpv6_sk_exit(struct net *net)
        kfree(net->ipv6.icmp_sk);
 }
 
-static struct pernet_operations __net_initdata icmpv6_sk_ops = {
+static struct pernet_operations icmpv6_sk_ops = {
        .init = icmpv6_sk_init,
        .exit = icmpv6_sk_exit,
 };
@@ -868,7 +884,7 @@ fail:
        return err;
 }
 
-void __exit icmpv6_cleanup(void)
+void icmpv6_cleanup(void)
 {
        unregister_pernet_subsys(&icmpv6_sk_ops);
        inet6_del_protocol(&icmpv6_protocol, IPPROTO_ICMPV6);
@@ -955,6 +971,10 @@ struct ctl_table *ipv6_icmp_sysctl_init(struct net *net)
        table = kmemdup(ipv6_icmp_table_template,
                        sizeof(ipv6_icmp_table_template),
                        GFP_KERNEL);
+
+       if (table)
+               table[0].data = &net->ipv6.sysctl.icmpv6_time;
+
        return table;
 }
 #endif