diff options
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 94 |
1 files changed, 45 insertions, 49 deletions
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 |