summaryrefslogtreecommitdiff
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-06-04 15:49:06 +0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-04 23:02:37 +0400
commit49d074f4009a7b5ce9c17b040f978abcb4d7f6f6 (patch)
treedde9d84731f79fc717df60e316ecae1b7b750bdb /net/ipv6/ipv6_sockglue.c
parent91e1908f569dd96a25a3947de8771e6cc93999dd (diff)
downloadlinux-49d074f4009a7b5ce9c17b040f978abcb4d7f6f6.tar.xz
[IPV6]: Do not change protocol for raw IPv6 sockets.
It is not allowed to change underlying protocol for int fd = socket(PF_INET6, SOCK_RAW, IPPROTO_UDP); Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r--net/ipv6/ipv6_sockglue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 3eef8e5b3636..1afe210d6286 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -161,6 +161,9 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
struct ipv6_txoptions *opt;
struct sk_buff *pktopt;
+ if (sk->sk_type == SOCK_RAW)
+ break;
+
if (sk->sk_protocol != IPPROTO_UDP &&
sk->sk_protocol != IPPROTO_UDPLITE &&
sk->sk_protocol != IPPROTO_TCP)