diff options
Diffstat (limited to 'net/ipv6/af_inet6.c')
| -rw-r--r-- | net/ipv6/af_inet6.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index e19457fe4f6e..e94eccb99707 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/capability.h> | 25 | #include <linux/capability.h> |
| 26 | #include <linux/config.h> | ||
| 27 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
| 28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
| 29 | #include <linux/socket.h> | 28 | #include <linux/socket.h> |
| @@ -60,6 +59,9 @@ | |||
| 60 | #ifdef CONFIG_IPV6_TUNNEL | 59 | #ifdef CONFIG_IPV6_TUNNEL |
| 61 | #include <net/ip6_tunnel.h> | 60 | #include <net/ip6_tunnel.h> |
| 62 | #endif | 61 | #endif |
| 62 | #ifdef CONFIG_IPV6_MIP6 | ||
| 63 | #include <net/mip6.h> | ||
| 64 | #endif | ||
| 63 | 65 | ||
| 64 | #include <asm/uaccess.h> | 66 | #include <asm/uaccess.h> |
| 65 | #include <asm/system.h> | 67 | #include <asm/system.h> |
| @@ -68,7 +70,7 @@ MODULE_AUTHOR("Cast of dozens"); | |||
| 68 | MODULE_DESCRIPTION("IPv6 protocol stack for Linux"); | 70 | MODULE_DESCRIPTION("IPv6 protocol stack for Linux"); |
| 69 | MODULE_LICENSE("GPL"); | 71 | MODULE_LICENSE("GPL"); |
| 70 | 72 | ||
| 71 | int sysctl_ipv6_bindv6only; | 73 | int sysctl_ipv6_bindv6only __read_mostly; |
| 72 | 74 | ||
| 73 | /* The inetsw table contains everything that inet_create needs to | 75 | /* The inetsw table contains everything that inet_create needs to |
| 74 | * build a new socket. | 76 | * build a new socket. |
| @@ -244,7 +246,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
| 244 | struct sock *sk = sock->sk; | 246 | struct sock *sk = sock->sk; |
| 245 | struct inet_sock *inet = inet_sk(sk); | 247 | struct inet_sock *inet = inet_sk(sk); |
| 246 | struct ipv6_pinfo *np = inet6_sk(sk); | 248 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 247 | __u32 v4addr = 0; | 249 | __be32 v4addr = 0; |
| 248 | unsigned short snum; | 250 | unsigned short snum; |
| 249 | int addr_type = 0; | 251 | int addr_type = 0; |
| 250 | int err = 0; | 252 | int err = 0; |
| @@ -638,6 +640,7 @@ int inet6_sk_rebuild_header(struct sock *sk) | |||
| 638 | fl.oif = sk->sk_bound_dev_if; | 640 | fl.oif = sk->sk_bound_dev_if; |
| 639 | fl.fl_ip_dport = inet->dport; | 641 | fl.fl_ip_dport = inet->dport; |
| 640 | fl.fl_ip_sport = inet->sport; | 642 | fl.fl_ip_sport = inet->sport; |
| 643 | security_sk_classify_flow(sk, &fl); | ||
| 641 | 644 | ||
| 642 | if (np->opt && np->opt->srcrt) { | 645 | if (np->opt && np->opt->srcrt) { |
| 643 | struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; | 646 | struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; |
| @@ -659,9 +662,7 @@ int inet6_sk_rebuild_header(struct sock *sk) | |||
| 659 | return err; | 662 | return err; |
| 660 | } | 663 | } |
| 661 | 664 | ||
| 662 | ip6_dst_store(sk, dst, NULL); | 665 | __ip6_dst_store(sk, dst, NULL, NULL); |
| 663 | sk->sk_route_caps = dst->dev->features & | ||
| 664 | ~(NETIF_F_IP_CSUM | NETIF_F_TSO); | ||
| 665 | } | 666 | } |
| 666 | 667 | ||
| 667 | return 0; | 668 | return 0; |
| @@ -760,6 +761,8 @@ static int __init inet6_init(void) | |||
| 760 | struct list_head *r; | 761 | struct list_head *r; |
| 761 | int err; | 762 | int err; |
| 762 | 763 | ||
| 764 | BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); | ||
| 765 | |||
| 763 | #ifdef MODULE | 766 | #ifdef MODULE |
| 764 | #if 0 /* FIXME --RR */ | 767 | #if 0 /* FIXME --RR */ |
| 765 | if (!mod_member_present(&__this_module, can_unload)) | 768 | if (!mod_member_present(&__this_module, can_unload)) |
| @@ -769,11 +772,6 @@ static int __init inet6_init(void) | |||
| 769 | #endif | 772 | #endif |
| 770 | #endif | 773 | #endif |
| 771 | 774 | ||
| 772 | if (sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)) { | ||
| 773 | printk(KERN_CRIT "inet6_proto_init: size fault\n"); | ||
| 774 | return -EINVAL; | ||
| 775 | } | ||
| 776 | |||
| 777 | err = proto_register(&tcpv6_prot, 1); | 775 | err = proto_register(&tcpv6_prot, 1); |
| 778 | if (err) | 776 | if (err) |
| 779 | goto out; | 777 | goto out; |
| @@ -859,6 +857,9 @@ static int __init inet6_init(void) | |||
| 859 | ipv6_frag_init(); | 857 | ipv6_frag_init(); |
| 860 | ipv6_nodata_init(); | 858 | ipv6_nodata_init(); |
| 861 | ipv6_destopt_init(); | 859 | ipv6_destopt_init(); |
| 860 | #ifdef CONFIG_IPV6_MIP6 | ||
| 861 | mip6_init(); | ||
| 862 | #endif | ||
| 862 | 863 | ||
| 863 | /* Init v6 transport protocols. */ | 864 | /* Init v6 transport protocols. */ |
| 864 | udpv6_init(); | 865 | udpv6_init(); |
| @@ -922,6 +923,9 @@ static void __exit inet6_exit(void) | |||
| 922 | tcp6_proc_exit(); | 923 | tcp6_proc_exit(); |
| 923 | raw6_proc_exit(); | 924 | raw6_proc_exit(); |
| 924 | #endif | 925 | #endif |
| 926 | #ifdef CONFIG_IPV6_MIP6 | ||
| 927 | mip6_fini(); | ||
| 928 | #endif | ||
| 925 | /* Cleanup code parts. */ | 929 | /* Cleanup code parts. */ |
| 926 | sit_cleanup(); | 930 | sit_cleanup(); |
| 927 | ip6_flowlabel_cleanup(); | 931 | ip6_flowlabel_cleanup(); |
