Files
linux-stable-mirror/include/uapi/linux
Maciej Żenczykowski 84e14fe353 net-ipv6: add support for sockopt(SOL_IPV6, IPV6_FREEBIND)
So far we've been relying on sockopt(SOL_IP, IP_FREEBIND) being usable
even on IPv6 sockets.

However, it turns out it is perfectly reasonable to want to set freebind
on an AF_INET6 SOCK_RAW socket - but there is no way to set any SOL_IP
socket option on such a socket (they're all blindly errored out).

One use case for this is to allow spoofing src ip on a raw socket
via sendmsg cmsg.

Tested:
  built, and booted
  # python
  >>> import socket
  >>> SOL_IP = socket.SOL_IP
  >>> SOL_IPV6 = socket.IPPROTO_IPV6
  >>> IP_FREEBIND = 15
  >>> IPV6_FREEBIND = 78
  >>> s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, 0)
  >>> s.getsockopt(SOL_IP, IP_FREEBIND)
  0
  >>> s.getsockopt(SOL_IPV6, IPV6_FREEBIND)
  0
  >>> s.setsockopt(SOL_IPV6, IPV6_FREEBIND, 1)
  >>> s.getsockopt(SOL_IP, IP_FREEBIND)
  1
  >>> s.getsockopt(SOL_IPV6, IPV6_FREEBIND)
  1

Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-30 05:30:52 +01:00
..
2017-08-31 17:32:38 -04:00
2017-09-29 06:17:05 +01:00
2017-08-15 09:02:09 -07:00
2017-08-20 08:14:03 -04:00
2017-08-31 14:42:19 -07:00
2017-08-03 21:37:29 -07:00
2017-08-31 17:32:38 -04:00
2017-07-06 16:24:30 -07:00
2017-08-08 06:03:15 -04:00
2017-05-30 08:20:25 -06:00
2017-09-07 13:24:16 -05:00
2017-07-01 15:26:11 -07:00
2017-08-04 10:30:27 +02:00
2017-06-15 12:12:40 -04:00
2017-06-05 16:58:59 +02:00