Skip to content

Commit

Permalink
[IPV6]: Do not change protocol for raw IPv6 sockets.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis V. Lunev authored and YOSHIFUJI Hideaki committed Jun 4, 2008
1 parent 91e1908 commit 49d074f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 49d074f

Please sign in to comment.