aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-06-04 07:49:06 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-04 15:02:37 -0400
commit49d074f4009a7b5ce9c17b040f978abcb4d7f6f6 (patch)
treedde9d84731f79fc717df60e316ecae1b7b750bdb
parent91e1908f569dd96a25a3947de8771e6cc93999dd (diff)
[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>
-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,
161 struct ipv6_txoptions *opt; 161 struct ipv6_txoptions *opt;
162 struct sk_buff *pktopt; 162 struct sk_buff *pktopt;
163 163
164 if (sk->sk_type == SOCK_RAW)
165 break;
166
164 if (sk->sk_protocol != IPPROTO_UDP && 167 if (sk->sk_protocol != IPPROTO_UDP &&
165 sk->sk_protocol != IPPROTO_UDPLITE && 168 sk->sk_protocol != IPPROTO_UDPLITE &&
166 sk->sk_protocol != IPPROTO_TCP) 169 sk->sk_protocol != IPPROTO_TCP)