Commit 76b2d8e9 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Andrei Vagin

inet: raw -- Skip IP_FREEBIND for ipv6 SOCK_RAW sockets

IP_FREEBIND is not supported for SOCK_RAW ipv6 sockets.
See kernel rawv6_setsockopt() for the details.

For the rest of sockets, where they begin to support it:
the actual magic happens in do_ipv6_setsockopt(), and
IPV6_ADDRFORM optname changes sk->sk_prot to refer
to tcp_prot, udp_prot and udplite_prot, which contains
link to ip_setsockopt().
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@gmail.com>
parent 31c1955d
...@@ -840,7 +840,7 @@ int inet_bind(int sk, struct inet_sk_info *ii) ...@@ -840,7 +840,7 @@ int inet_bind(int sk, struct inet_sk_info *ii)
* sockets could not be bound to them in this moment * sockets could not be bound to them in this moment
* without setting IP_FREEBIND. * without setting IP_FREEBIND.
*/ */
if (ii->ie->family == AF_INET6) { if (ii->ie->family == AF_INET6 && ii->ie->type != SOCK_RAW) {
int yes = 1; int yes = 1;
if (restore_opt(sk, SOL_IP, IP_FREEBIND, &yes)) if (restore_opt(sk, SOL_IP, IP_FREEBIND, &yes))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment