diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/af_inet6.c | 120 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 40 | ||||
-rw-r--r-- | net/ipv6/ipv6_syms.c | 4 | ||||
-rw-r--r-- | net/ipv6/raw.c | 94 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 64 | ||||
-rw-r--r-- | net/ipv6/udp.c | 48 |
6 files changed, 179 insertions, 191 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 97844c4cd9b1..e19457fe4f6e 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -456,53 +456,53 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
456 | } | 456 | } |
457 | 457 | ||
458 | const struct proto_ops inet6_stream_ops = { | 458 | const struct proto_ops inet6_stream_ops = { |
459 | .family = PF_INET6, | 459 | .family = PF_INET6, |
460 | .owner = THIS_MODULE, | 460 | .owner = THIS_MODULE, |
461 | .release = inet6_release, | 461 | .release = inet6_release, |
462 | .bind = inet6_bind, | 462 | .bind = inet6_bind, |
463 | .connect = inet_stream_connect, /* ok */ | 463 | .connect = inet_stream_connect, /* ok */ |
464 | .socketpair = sock_no_socketpair, /* a do nothing */ | 464 | .socketpair = sock_no_socketpair, /* a do nothing */ |
465 | .accept = inet_accept, /* ok */ | 465 | .accept = inet_accept, /* ok */ |
466 | .getname = inet6_getname, | 466 | .getname = inet6_getname, |
467 | .poll = tcp_poll, /* ok */ | 467 | .poll = tcp_poll, /* ok */ |
468 | .ioctl = inet6_ioctl, /* must change */ | 468 | .ioctl = inet6_ioctl, /* must change */ |
469 | .listen = inet_listen, /* ok */ | 469 | .listen = inet_listen, /* ok */ |
470 | .shutdown = inet_shutdown, /* ok */ | 470 | .shutdown = inet_shutdown, /* ok */ |
471 | .setsockopt = sock_common_setsockopt, /* ok */ | 471 | .setsockopt = sock_common_setsockopt, /* ok */ |
472 | .getsockopt = sock_common_getsockopt, /* ok */ | 472 | .getsockopt = sock_common_getsockopt, /* ok */ |
473 | .sendmsg = inet_sendmsg, /* ok */ | ||
474 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
475 | .mmap = sock_no_mmap, | ||
476 | .sendpage = tcp_sendpage, | ||
473 | #ifdef CONFIG_COMPAT | 477 | #ifdef CONFIG_COMPAT |
474 | .compat_setsockopt = compat_sock_common_setsockopt, | 478 | .compat_setsockopt = compat_sock_common_setsockopt, |
475 | .compat_getsockopt = compat_sock_common_getsockopt, | 479 | .compat_getsockopt = compat_sock_common_getsockopt, |
476 | #endif | 480 | #endif |
477 | .sendmsg = inet_sendmsg, /* ok */ | ||
478 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
479 | .mmap = sock_no_mmap, | ||
480 | .sendpage = tcp_sendpage | ||
481 | }; | 481 | }; |
482 | 482 | ||
483 | const struct proto_ops inet6_dgram_ops = { | 483 | const struct proto_ops inet6_dgram_ops = { |
484 | .family = PF_INET6, | 484 | .family = PF_INET6, |
485 | .owner = THIS_MODULE, | 485 | .owner = THIS_MODULE, |
486 | .release = inet6_release, | 486 | .release = inet6_release, |
487 | .bind = inet6_bind, | 487 | .bind = inet6_bind, |
488 | .connect = inet_dgram_connect, /* ok */ | 488 | .connect = inet_dgram_connect, /* ok */ |
489 | .socketpair = sock_no_socketpair, /* a do nothing */ | 489 | .socketpair = sock_no_socketpair, /* a do nothing */ |
490 | .accept = sock_no_accept, /* a do nothing */ | 490 | .accept = sock_no_accept, /* a do nothing */ |
491 | .getname = inet6_getname, | 491 | .getname = inet6_getname, |
492 | .poll = udp_poll, /* ok */ | 492 | .poll = udp_poll, /* ok */ |
493 | .ioctl = inet6_ioctl, /* must change */ | 493 | .ioctl = inet6_ioctl, /* must change */ |
494 | .listen = sock_no_listen, /* ok */ | 494 | .listen = sock_no_listen, /* ok */ |
495 | .shutdown = inet_shutdown, /* ok */ | 495 | .shutdown = inet_shutdown, /* ok */ |
496 | .setsockopt = sock_common_setsockopt, /* ok */ | 496 | .setsockopt = sock_common_setsockopt, /* ok */ |
497 | .getsockopt = sock_common_getsockopt, /* ok */ | 497 | .getsockopt = sock_common_getsockopt, /* ok */ |
498 | .sendmsg = inet_sendmsg, /* ok */ | ||
499 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
500 | .mmap = sock_no_mmap, | ||
501 | .sendpage = sock_no_sendpage, | ||
498 | #ifdef CONFIG_COMPAT | 502 | #ifdef CONFIG_COMPAT |
499 | .compat_setsockopt = compat_sock_common_setsockopt, | 503 | .compat_setsockopt = compat_sock_common_setsockopt, |
500 | .compat_getsockopt = compat_sock_common_getsockopt, | 504 | .compat_getsockopt = compat_sock_common_getsockopt, |
501 | #endif | 505 | #endif |
502 | .sendmsg = inet_sendmsg, /* ok */ | ||
503 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
504 | .mmap = sock_no_mmap, | ||
505 | .sendpage = sock_no_sendpage, | ||
506 | }; | 506 | }; |
507 | 507 | ||
508 | static struct net_proto_family inet6_family_ops = { | 508 | static struct net_proto_family inet6_family_ops = { |
@@ -513,28 +513,28 @@ static struct net_proto_family inet6_family_ops = { | |||
513 | 513 | ||
514 | /* Same as inet6_dgram_ops, sans udp_poll. */ | 514 | /* Same as inet6_dgram_ops, sans udp_poll. */ |
515 | static const struct proto_ops inet6_sockraw_ops = { | 515 | static const struct proto_ops inet6_sockraw_ops = { |
516 | .family = PF_INET6, | 516 | .family = PF_INET6, |
517 | .owner = THIS_MODULE, | 517 | .owner = THIS_MODULE, |
518 | .release = inet6_release, | 518 | .release = inet6_release, |
519 | .bind = inet6_bind, | 519 | .bind = inet6_bind, |
520 | .connect = inet_dgram_connect, /* ok */ | 520 | .connect = inet_dgram_connect, /* ok */ |
521 | .socketpair = sock_no_socketpair, /* a do nothing */ | 521 | .socketpair = sock_no_socketpair, /* a do nothing */ |
522 | .accept = sock_no_accept, /* a do nothing */ | 522 | .accept = sock_no_accept, /* a do nothing */ |
523 | .getname = inet6_getname, | 523 | .getname = inet6_getname, |
524 | .poll = datagram_poll, /* ok */ | 524 | .poll = datagram_poll, /* ok */ |
525 | .ioctl = inet6_ioctl, /* must change */ | 525 | .ioctl = inet6_ioctl, /* must change */ |
526 | .listen = sock_no_listen, /* ok */ | 526 | .listen = sock_no_listen, /* ok */ |
527 | .shutdown = inet_shutdown, /* ok */ | 527 | .shutdown = inet_shutdown, /* ok */ |
528 | .setsockopt = sock_common_setsockopt, /* ok */ | 528 | .setsockopt = sock_common_setsockopt, /* ok */ |
529 | .getsockopt = sock_common_getsockopt, /* ok */ | 529 | .getsockopt = sock_common_getsockopt, /* ok */ |
530 | .sendmsg = inet_sendmsg, /* ok */ | ||
531 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
532 | .mmap = sock_no_mmap, | ||
533 | .sendpage = sock_no_sendpage, | ||
530 | #ifdef CONFIG_COMPAT | 534 | #ifdef CONFIG_COMPAT |
531 | .compat_setsockopt = compat_sock_common_setsockopt, | 535 | .compat_setsockopt = compat_sock_common_setsockopt, |
532 | .compat_getsockopt = compat_sock_common_getsockopt, | 536 | .compat_getsockopt = compat_sock_common_getsockopt, |
533 | #endif | 537 | #endif |
534 | .sendmsg = inet_sendmsg, /* ok */ | ||
535 | .recvmsg = sock_common_recvmsg, /* ok */ | ||
536 | .mmap = sock_no_mmap, | ||
537 | .sendpage = sock_no_sendpage, | ||
538 | }; | 538 | }; |
539 | 539 | ||
540 | static struct inet_protosw rawv6_protosw = { | 540 | static struct inet_protosw rawv6_protosw = { |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 988eac58e9d1..602feec47738 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -645,17 +645,15 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
645 | 645 | ||
646 | #ifdef CONFIG_COMPAT | 646 | #ifdef CONFIG_COMPAT |
647 | int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, | 647 | int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, |
648 | char __user *optval, int optlen) | 648 | char __user *optval, int optlen) |
649 | { | 649 | { |
650 | int err; | 650 | int err; |
651 | 651 | ||
652 | if (level == SOL_IP && sk->sk_type != SOCK_RAW) { | 652 | if (level == SOL_IP && sk->sk_type != SOCK_RAW) { |
653 | if (udp_prot.compat_setsockopt) | 653 | if (udp_prot.compat_setsockopt != NULL) |
654 | return udp_prot.compat_setsockopt(sk, level, | 654 | return udp_prot.compat_setsockopt(sk, level, optname, |
655 | optname, optval, optlen); | 655 | optval, optlen); |
656 | else | 656 | return udp_prot.setsockopt(sk, level, optname, optval, optlen); |
657 | return udp_prot.setsockopt(sk, level, | ||
658 | optname, optval, optlen); | ||
659 | } | 657 | } |
660 | 658 | ||
661 | if (level != SOL_IPV6) | 659 | if (level != SOL_IPV6) |
@@ -665,15 +663,17 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
665 | #ifdef CONFIG_NETFILTER | 663 | #ifdef CONFIG_NETFILTER |
666 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 664 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
667 | if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY && | 665 | if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY && |
668 | optname != IPV6_XFRM_POLICY) { | 666 | optname != IPV6_XFRM_POLICY) { |
669 | lock_sock(sk); | 667 | lock_sock(sk); |
670 | err = compat_nf_setsockopt(sk, PF_INET6, optname, optval, | 668 | err = compat_nf_setsockopt(sk, PF_INET6, optname, |
671 | optlen); | 669 | optval, optlen); |
672 | release_sock(sk); | 670 | release_sock(sk); |
673 | } | 671 | } |
674 | #endif | 672 | #endif |
675 | return err; | 673 | return err; |
676 | } | 674 | } |
675 | |||
676 | EXPORT_SYMBOL(compat_ipv6_setsockopt); | ||
677 | #endif | 677 | #endif |
678 | 678 | ||
679 | static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, | 679 | static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, |
@@ -927,20 +927,18 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
927 | 927 | ||
928 | #ifdef CONFIG_COMPAT | 928 | #ifdef CONFIG_COMPAT |
929 | int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | 929 | int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, |
930 | char __user *optval, int __user *optlen) | 930 | char __user *optval, int __user *optlen) |
931 | { | 931 | { |
932 | int err; | 932 | int err; |
933 | 933 | ||
934 | if (level == SOL_IP && sk->sk_type != SOCK_RAW) { | 934 | if (level == SOL_IP && sk->sk_type != SOCK_RAW) { |
935 | if (udp_prot.compat_getsockopt) | 935 | if (udp_prot.compat_getsockopt != NULL) |
936 | return udp_prot.compat_getsockopt(sk, level, | 936 | return udp_prot.compat_getsockopt(sk, level, optname, |
937 | optname, optval, optlen); | 937 | optval, optlen); |
938 | else | 938 | return udp_prot.getsockopt(sk, level, optname, optval, optlen); |
939 | return udp_prot.getsockopt(sk, level, | ||
940 | optname, optval, optlen); | ||
941 | } | 939 | } |
942 | 940 | ||
943 | if(level != SOL_IPV6) | 941 | if (level != SOL_IPV6) |
944 | return -ENOPROTOOPT; | 942 | return -ENOPROTOOPT; |
945 | 943 | ||
946 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); | 944 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); |
@@ -954,8 +952,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
954 | return -EFAULT; | 952 | return -EFAULT; |
955 | 953 | ||
956 | lock_sock(sk); | 954 | lock_sock(sk); |
957 | err = compat_nf_getsockopt(sk, PF_INET6, optname, optval, | 955 | err = compat_nf_getsockopt(sk, PF_INET6, |
958 | &len); | 956 | optname, optval, &len); |
959 | release_sock(sk); | 957 | release_sock(sk); |
960 | if (err >= 0) | 958 | if (err >= 0) |
961 | err = put_user(len, optlen); | 959 | err = put_user(len, optlen); |
@@ -963,6 +961,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
963 | #endif | 961 | #endif |
964 | return err; | 962 | return err; |
965 | } | 963 | } |
964 | |||
965 | EXPORT_SYMBOL(compat_ipv6_getsockopt); | ||
966 | #endif | 966 | #endif |
967 | 967 | ||
968 | void __init ipv6_packet_init(void) | 968 | void __init ipv6_packet_init(void) |
diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c index 61419e11e35d..16482785bdfd 100644 --- a/net/ipv6/ipv6_syms.c +++ b/net/ipv6/ipv6_syms.c | |||
@@ -18,10 +18,6 @@ EXPORT_SYMBOL(ip6_route_output); | |||
18 | EXPORT_SYMBOL(addrconf_lock); | 18 | EXPORT_SYMBOL(addrconf_lock); |
19 | EXPORT_SYMBOL(ipv6_setsockopt); | 19 | EXPORT_SYMBOL(ipv6_setsockopt); |
20 | EXPORT_SYMBOL(ipv6_getsockopt); | 20 | EXPORT_SYMBOL(ipv6_getsockopt); |
21 | #ifdef CONFIG_COMPAT | ||
22 | EXPORT_SYMBOL(compat_ipv6_setsockopt); | ||
23 | EXPORT_SYMBOL(compat_ipv6_getsockopt); | ||
24 | #endif | ||
25 | EXPORT_SYMBOL(inet6_register_protosw); | 21 | EXPORT_SYMBOL(inet6_register_protosw); |
26 | EXPORT_SYMBOL(inet6_unregister_protosw); | 22 | EXPORT_SYMBOL(inet6_unregister_protosw); |
27 | EXPORT_SYMBOL(inet6_add_protocol); | 23 | EXPORT_SYMBOL(inet6_add_protocol); |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 8de5a8e59149..0f63078af41f 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -913,23 +913,21 @@ static int rawv6_setsockopt(struct sock *sk, int level, int optname, | |||
913 | 913 | ||
914 | #ifdef CONFIG_COMPAT | 914 | #ifdef CONFIG_COMPAT |
915 | static int compat_rawv6_setsockopt(struct sock *sk, int level, int optname, | 915 | static int compat_rawv6_setsockopt(struct sock *sk, int level, int optname, |
916 | char __user *optval, int optlen) | 916 | char __user *optval, int optlen) |
917 | { | 917 | { |
918 | switch(level) { | 918 | switch (level) { |
919 | case SOL_RAW: | 919 | case SOL_RAW: |
920 | break; | ||
921 | case SOL_ICMPV6: | ||
922 | if (inet_sk(sk)->num != IPPROTO_ICMPV6) | ||
923 | return -EOPNOTSUPP; | ||
924 | return rawv6_seticmpfilter(sk, level, optname, optval, optlen); | ||
925 | case SOL_IPV6: | ||
926 | if (optname == IPV6_CHECKSUM) | ||
920 | break; | 927 | break; |
921 | 928 | default: | |
922 | case SOL_ICMPV6: | 929 | return compat_ipv6_setsockopt(sk, level, optname, |
923 | if (inet_sk(sk)->num != IPPROTO_ICMPV6) | 930 | optval, optlen); |
924 | return -EOPNOTSUPP; | ||
925 | return rawv6_seticmpfilter(sk, level, optname, optval, | ||
926 | optlen); | ||
927 | case SOL_IPV6: | ||
928 | if (optname == IPV6_CHECKSUM) | ||
929 | break; | ||
930 | default: | ||
931 | return compat_ipv6_setsockopt(sk, level, | ||
932 | optname, optval, optlen); | ||
933 | }; | 931 | }; |
934 | return do_rawv6_setsockopt(sk, level, optname, optval, optlen); | 932 | return do_rawv6_setsockopt(sk, level, optname, optval, optlen); |
935 | } | 933 | } |
@@ -989,23 +987,21 @@ static int rawv6_getsockopt(struct sock *sk, int level, int optname, | |||
989 | 987 | ||
990 | #ifdef CONFIG_COMPAT | 988 | #ifdef CONFIG_COMPAT |
991 | static int compat_rawv6_getsockopt(struct sock *sk, int level, int optname, | 989 | static int compat_rawv6_getsockopt(struct sock *sk, int level, int optname, |
992 | char __user *optval, int __user *optlen) | 990 | char __user *optval, int __user *optlen) |
993 | { | 991 | { |
994 | switch(level) { | 992 | switch (level) { |
995 | case SOL_RAW: | 993 | case SOL_RAW: |
994 | break; | ||
995 | case SOL_ICMPV6: | ||
996 | if (inet_sk(sk)->num != IPPROTO_ICMPV6) | ||
997 | return -EOPNOTSUPP; | ||
998 | return rawv6_geticmpfilter(sk, level, optname, optval, optlen); | ||
999 | case SOL_IPV6: | ||
1000 | if (optname == IPV6_CHECKSUM) | ||
996 | break; | 1001 | break; |
997 | 1002 | default: | |
998 | case SOL_ICMPV6: | 1003 | return compat_ipv6_getsockopt(sk, level, optname, |
999 | if (inet_sk(sk)->num != IPPROTO_ICMPV6) | 1004 | optval, optlen); |
1000 | return -EOPNOTSUPP; | ||
1001 | return rawv6_geticmpfilter(sk, level, optname, optval, | ||
1002 | optlen); | ||
1003 | case SOL_IPV6: | ||
1004 | if (optname == IPV6_CHECKSUM) | ||
1005 | break; | ||
1006 | default: | ||
1007 | return compat_ipv6_getsockopt(sk, level, | ||
1008 | optname, optval, optlen); | ||
1009 | }; | 1005 | }; |
1010 | return do_rawv6_getsockopt(sk, level, optname, optval, optlen); | 1006 | return do_rawv6_getsockopt(sk, level, optname, optval, optlen); |
1011 | } | 1007 | } |
@@ -1056,27 +1052,27 @@ static int rawv6_init_sk(struct sock *sk) | |||
1056 | } | 1052 | } |
1057 | 1053 | ||
1058 | struct proto rawv6_prot = { | 1054 | struct proto rawv6_prot = { |
1059 | .name = "RAWv6", | 1055 | .name = "RAWv6", |
1060 | .owner = THIS_MODULE, | 1056 | .owner = THIS_MODULE, |
1061 | .close = rawv6_close, | 1057 | .close = rawv6_close, |
1062 | .connect = ip6_datagram_connect, | 1058 | .connect = ip6_datagram_connect, |
1063 | .disconnect = udp_disconnect, | 1059 | .disconnect = udp_disconnect, |
1064 | .ioctl = rawv6_ioctl, | 1060 | .ioctl = rawv6_ioctl, |
1065 | .init = rawv6_init_sk, | 1061 | .init = rawv6_init_sk, |
1066 | .destroy = inet6_destroy_sock, | 1062 | .destroy = inet6_destroy_sock, |
1067 | .setsockopt = rawv6_setsockopt, | 1063 | .setsockopt = rawv6_setsockopt, |
1068 | .getsockopt = rawv6_getsockopt, | 1064 | .getsockopt = rawv6_getsockopt, |
1065 | .sendmsg = rawv6_sendmsg, | ||
1066 | .recvmsg = rawv6_recvmsg, | ||
1067 | .bind = rawv6_bind, | ||
1068 | .backlog_rcv = rawv6_rcv_skb, | ||
1069 | .hash = raw_v6_hash, | ||
1070 | .unhash = raw_v6_unhash, | ||
1071 | .obj_size = sizeof(struct raw6_sock), | ||
1069 | #ifdef CONFIG_COMPAT | 1072 | #ifdef CONFIG_COMPAT |
1070 | .compat_setsockopt = compat_rawv6_setsockopt, | 1073 | .compat_setsockopt = compat_rawv6_setsockopt, |
1071 | .compat_getsockopt = compat_rawv6_getsockopt, | 1074 | .compat_getsockopt = compat_rawv6_getsockopt, |
1072 | #endif | 1075 | #endif |
1073 | .sendmsg = rawv6_sendmsg, | ||
1074 | .recvmsg = rawv6_recvmsg, | ||
1075 | .bind = rawv6_bind, | ||
1076 | .backlog_rcv = rawv6_rcv_skb, | ||
1077 | .hash = raw_v6_hash, | ||
1078 | .unhash = raw_v6_unhash, | ||
1079 | .obj_size = sizeof(struct raw6_sock), | ||
1080 | }; | 1076 | }; |
1081 | 1077 | ||
1082 | #ifdef CONFIG_PROC_FS | 1078 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 2f8975e0150a..301eee726b0f 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1298,22 +1298,21 @@ static int tcp_v6_remember_stamp(struct sock *sk) | |||
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | static struct inet_connection_sock_af_ops ipv6_specific = { | 1300 | static struct inet_connection_sock_af_ops ipv6_specific = { |
1301 | .queue_xmit = inet6_csk_xmit, | 1301 | .queue_xmit = inet6_csk_xmit, |
1302 | .send_check = tcp_v6_send_check, | 1302 | .send_check = tcp_v6_send_check, |
1303 | .rebuild_header = inet6_sk_rebuild_header, | 1303 | .rebuild_header = inet6_sk_rebuild_header, |
1304 | .conn_request = tcp_v6_conn_request, | 1304 | .conn_request = tcp_v6_conn_request, |
1305 | .syn_recv_sock = tcp_v6_syn_recv_sock, | 1305 | .syn_recv_sock = tcp_v6_syn_recv_sock, |
1306 | .remember_stamp = tcp_v6_remember_stamp, | 1306 | .remember_stamp = tcp_v6_remember_stamp, |
1307 | .net_header_len = sizeof(struct ipv6hdr), | 1307 | .net_header_len = sizeof(struct ipv6hdr), |
1308 | 1308 | .setsockopt = ipv6_setsockopt, | |
1309 | .setsockopt = ipv6_setsockopt, | 1309 | .getsockopt = ipv6_getsockopt, |
1310 | .getsockopt = ipv6_getsockopt, | 1310 | .addr2sockaddr = inet6_csk_addr2sockaddr, |
1311 | .sockaddr_len = sizeof(struct sockaddr_in6), | ||
1311 | #ifdef CONFIG_COMPAT | 1312 | #ifdef CONFIG_COMPAT |
1312 | .compat_setsockopt = compat_ipv6_setsockopt, | 1313 | .compat_setsockopt = compat_ipv6_setsockopt, |
1313 | .compat_getsockopt = compat_ipv6_getsockopt, | 1314 | .compat_getsockopt = compat_ipv6_getsockopt, |
1314 | #endif | 1315 | #endif |
1315 | .addr2sockaddr = inet6_csk_addr2sockaddr, | ||
1316 | .sockaddr_len = sizeof(struct sockaddr_in6) | ||
1317 | }; | 1316 | }; |
1318 | 1317 | ||
1319 | /* | 1318 | /* |
@@ -1321,26 +1320,23 @@ static struct inet_connection_sock_af_ops ipv6_specific = { | |||
1321 | */ | 1320 | */ |
1322 | 1321 | ||
1323 | static struct inet_connection_sock_af_ops ipv6_mapped = { | 1322 | static struct inet_connection_sock_af_ops ipv6_mapped = { |
1324 | .queue_xmit = ip_queue_xmit, | 1323 | .queue_xmit = ip_queue_xmit, |
1325 | .send_check = tcp_v4_send_check, | 1324 | .send_check = tcp_v4_send_check, |
1326 | .rebuild_header = inet_sk_rebuild_header, | 1325 | .rebuild_header = inet_sk_rebuild_header, |
1327 | .conn_request = tcp_v6_conn_request, | 1326 | .conn_request = tcp_v6_conn_request, |
1328 | .syn_recv_sock = tcp_v6_syn_recv_sock, | 1327 | .syn_recv_sock = tcp_v6_syn_recv_sock, |
1329 | .remember_stamp = tcp_v4_remember_stamp, | 1328 | .remember_stamp = tcp_v4_remember_stamp, |
1330 | .net_header_len = sizeof(struct iphdr), | 1329 | .net_header_len = sizeof(struct iphdr), |
1331 | 1330 | .setsockopt = ipv6_setsockopt, | |
1332 | .setsockopt = ipv6_setsockopt, | 1331 | .getsockopt = ipv6_getsockopt, |
1333 | .getsockopt = ipv6_getsockopt, | 1332 | .addr2sockaddr = inet6_csk_addr2sockaddr, |
1333 | .sockaddr_len = sizeof(struct sockaddr_in6), | ||
1334 | #ifdef CONFIG_COMPAT | 1334 | #ifdef CONFIG_COMPAT |
1335 | .compat_setsockopt = compat_ipv6_setsockopt, | 1335 | .compat_setsockopt = compat_ipv6_setsockopt, |
1336 | .compat_getsockopt = compat_ipv6_getsockopt, | 1336 | .compat_getsockopt = compat_ipv6_getsockopt, |
1337 | #endif | 1337 | #endif |
1338 | .addr2sockaddr = inet6_csk_addr2sockaddr, | ||
1339 | .sockaddr_len = sizeof(struct sockaddr_in6) | ||
1340 | }; | 1338 | }; |
1341 | 1339 | ||
1342 | |||
1343 | |||
1344 | /* NOTE: A lot of things set to zero explicitly by call to | 1340 | /* NOTE: A lot of things set to zero explicitly by call to |
1345 | * sk_alloc() so need not be done here. | 1341 | * sk_alloc() so need not be done here. |
1346 | */ | 1342 | */ |
@@ -1574,10 +1570,6 @@ struct proto tcpv6_prot = { | |||
1574 | .shutdown = tcp_shutdown, | 1570 | .shutdown = tcp_shutdown, |
1575 | .setsockopt = tcp_setsockopt, | 1571 | .setsockopt = tcp_setsockopt, |
1576 | .getsockopt = tcp_getsockopt, | 1572 | .getsockopt = tcp_getsockopt, |
1577 | #ifdef CONFIG_COMPAT | ||
1578 | .compat_setsockopt = compat_tcp_setsockopt, | ||
1579 | .compat_getsockopt = compat_tcp_getsockopt, | ||
1580 | #endif | ||
1581 | .sendmsg = tcp_sendmsg, | 1573 | .sendmsg = tcp_sendmsg, |
1582 | .recvmsg = tcp_recvmsg, | 1574 | .recvmsg = tcp_recvmsg, |
1583 | .backlog_rcv = tcp_v6_do_rcv, | 1575 | .backlog_rcv = tcp_v6_do_rcv, |
@@ -1596,6 +1588,10 @@ struct proto tcpv6_prot = { | |||
1596 | .obj_size = sizeof(struct tcp6_sock), | 1588 | .obj_size = sizeof(struct tcp6_sock), |
1597 | .twsk_prot = &tcp6_timewait_sock_ops, | 1589 | .twsk_prot = &tcp6_timewait_sock_ops, |
1598 | .rsk_prot = &tcp6_request_sock_ops, | 1590 | .rsk_prot = &tcp6_request_sock_ops, |
1591 | #ifdef CONFIG_COMPAT | ||
1592 | .compat_setsockopt = compat_tcp_setsockopt, | ||
1593 | .compat_getsockopt = compat_tcp_getsockopt, | ||
1594 | #endif | ||
1599 | }; | 1595 | }; |
1600 | 1596 | ||
1601 | static struct inet6_protocol tcpv6_protocol = { | 1597 | static struct inet6_protocol tcpv6_protocol = { |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 538ada00646a..8d3432a70f3a 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -934,11 +934,11 @@ static int udpv6_setsockopt(struct sock *sk, int level, int optname, | |||
934 | 934 | ||
935 | #ifdef CONFIG_COMPAT | 935 | #ifdef CONFIG_COMPAT |
936 | static int compat_udpv6_setsockopt(struct sock *sk, int level, int optname, | 936 | static int compat_udpv6_setsockopt(struct sock *sk, int level, int optname, |
937 | char __user *optval, int optlen) | 937 | char __user *optval, int optlen) |
938 | { | 938 | { |
939 | if (level != SOL_UDP) | 939 | if (level != SOL_UDP) |
940 | return compat_ipv6_setsockopt(sk, level, | 940 | return compat_ipv6_setsockopt(sk, level, optname, |
941 | optname, optval, optlen); | 941 | optval, optlen); |
942 | return do_udpv6_setsockopt(sk, level, optname, optval, optlen); | 942 | return do_udpv6_setsockopt(sk, level, optname, optval, optlen); |
943 | } | 943 | } |
944 | #endif | 944 | #endif |
@@ -987,11 +987,11 @@ static int udpv6_getsockopt(struct sock *sk, int level, int optname, | |||
987 | 987 | ||
988 | #ifdef CONFIG_COMPAT | 988 | #ifdef CONFIG_COMPAT |
989 | static int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, | 989 | static int compat_udpv6_getsockopt(struct sock *sk, int level, int optname, |
990 | char __user *optval, int __user *optlen) | 990 | char __user *optval, int __user *optlen) |
991 | { | 991 | { |
992 | if (level != SOL_UDP) | 992 | if (level != SOL_UDP) |
993 | return compat_ipv6_getsockopt(sk, level, | 993 | return compat_ipv6_getsockopt(sk, level, optname, |
994 | optname, optval, optlen); | 994 | optval, optlen); |
995 | return do_udpv6_getsockopt(sk, level, optname, optval, optlen); | 995 | return do_udpv6_getsockopt(sk, level, optname, optval, optlen); |
996 | } | 996 | } |
997 | #endif | 997 | #endif |
@@ -1069,26 +1069,26 @@ void udp6_proc_exit(void) { | |||
1069 | /* ------------------------------------------------------------------------ */ | 1069 | /* ------------------------------------------------------------------------ */ |
1070 | 1070 | ||
1071 | struct proto udpv6_prot = { | 1071 | struct proto udpv6_prot = { |
1072 | .name = "UDPv6", | 1072 | .name = "UDPv6", |
1073 | .owner = THIS_MODULE, | 1073 | .owner = THIS_MODULE, |
1074 | .close = udpv6_close, | 1074 | .close = udpv6_close, |
1075 | .connect = ip6_datagram_connect, | 1075 | .connect = ip6_datagram_connect, |
1076 | .disconnect = udp_disconnect, | 1076 | .disconnect = udp_disconnect, |
1077 | .ioctl = udp_ioctl, | 1077 | .ioctl = udp_ioctl, |
1078 | .destroy = udpv6_destroy_sock, | 1078 | .destroy = udpv6_destroy_sock, |
1079 | .setsockopt = udpv6_setsockopt, | 1079 | .setsockopt = udpv6_setsockopt, |
1080 | .getsockopt = udpv6_getsockopt, | 1080 | .getsockopt = udpv6_getsockopt, |
1081 | .sendmsg = udpv6_sendmsg, | ||
1082 | .recvmsg = udpv6_recvmsg, | ||
1083 | .backlog_rcv = udpv6_queue_rcv_skb, | ||
1084 | .hash = udp_v6_hash, | ||
1085 | .unhash = udp_v6_unhash, | ||
1086 | .get_port = udp_v6_get_port, | ||
1087 | .obj_size = sizeof(struct udp6_sock), | ||
1081 | #ifdef CONFIG_COMPAT | 1088 | #ifdef CONFIG_COMPAT |
1082 | .compat_setsockopt = compat_udpv6_setsockopt, | 1089 | .compat_setsockopt = compat_udpv6_setsockopt, |
1083 | .compat_getsockopt = compat_udpv6_getsockopt, | 1090 | .compat_getsockopt = compat_udpv6_getsockopt, |
1084 | #endif | 1091 | #endif |
1085 | .sendmsg = udpv6_sendmsg, | ||
1086 | .recvmsg = udpv6_recvmsg, | ||
1087 | .backlog_rcv = udpv6_queue_rcv_skb, | ||
1088 | .hash = udp_v6_hash, | ||
1089 | .unhash = udp_v6_unhash, | ||
1090 | .get_port = udp_v6_get_port, | ||
1091 | .obj_size = sizeof(struct udp6_sock), | ||
1092 | }; | 1092 | }; |
1093 | 1093 | ||
1094 | static struct inet_protosw udpv6_protosw = { | 1094 | static struct inet_protosw udpv6_protosw = { |