[NET]: Use BUILD_BUG_ON() for checking size of skb->cb.
[deliverable/linux.git] / net / ipv6 / af_inet6.c
index e19457fe4f6edb79ef059dbf88f93ed1836bc8d9..bf6e8aff19d4f2fa62a5e18641548bd0a4e2a60b 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <linux/module.h>
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -60,6 +59,9 @@
 #ifdef CONFIG_IPV6_TUNNEL
 #include <net/ip6_tunnel.h>
 #endif
+#ifdef CONFIG_IPV6_MIP6
+#include <net/mip6.h>
+#endif
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -68,7 +70,7 @@ MODULE_AUTHOR("Cast of dozens");
 MODULE_DESCRIPTION("IPv6 protocol stack for Linux");
 MODULE_LICENSE("GPL");
 
-int sysctl_ipv6_bindv6only;
+int sysctl_ipv6_bindv6only __read_mostly;
 
 /* The inetsw table contains everything that inet_create needs to
  * build a new socket.
@@ -638,6 +640,7 @@ int inet6_sk_rebuild_header(struct sock *sk)
                fl.oif = sk->sk_bound_dev_if;
                fl.fl_ip_dport = inet->dport;
                fl.fl_ip_sport = inet->sport;
+               security_sk_classify_flow(sk, &fl);
 
                if (np->opt && np->opt->srcrt) {
                        struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
@@ -659,9 +662,7 @@ int inet6_sk_rebuild_header(struct sock *sk)
                        return err;
                }
 
-               ip6_dst_store(sk, dst, NULL);
-               sk->sk_route_caps = dst->dev->features &
-                       ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+               __ip6_dst_store(sk, dst, NULL, NULL);
        }
 
        return 0;
@@ -760,6 +761,8 @@ static int __init inet6_init(void)
         struct list_head *r;
        int err;
 
+       BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));
+
 #ifdef MODULE
 #if 0 /* FIXME --RR */
        if (!mod_member_present(&__this_module, can_unload))
@@ -769,11 +772,6 @@ static int __init inet6_init(void)
 #endif
 #endif
 
-       if (sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)) {
-               printk(KERN_CRIT "inet6_proto_init: size fault\n");
-               return -EINVAL;
-       }
-
        err = proto_register(&tcpv6_prot, 1);
        if (err)
                goto out;
@@ -859,6 +857,9 @@ static int __init inet6_init(void)
        ipv6_frag_init();
        ipv6_nodata_init();
        ipv6_destopt_init();
+#ifdef CONFIG_IPV6_MIP6
+       mip6_init();
+#endif
 
        /* Init v6 transport protocols. */
        udpv6_init();
@@ -921,6 +922,9 @@ static void __exit inet6_exit(void)
        udp6_proc_exit();
        tcp6_proc_exit();
        raw6_proc_exit();
+#endif
+#ifdef CONFIG_IPV6_MIP6
+       mip6_fini();
 #endif
        /* Cleanup code parts. */
        sit_cleanup();
This page took 0.029097 seconds and 5 git commands to generate.