Commit 55067e03 authored by David S. Miller's avatar David S. Miller

net/ipv6/ipv6_sockglue.c: Support IPV6_ADDRFORM getsockopt.

parent ed2f6ca5
...@@ -412,6 +412,15 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval, ...@@ -412,6 +412,15 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval,
if (get_user(len, optlen)) if (get_user(len, optlen))
return -EFAULT; return -EFAULT;
switch (optname) { switch (optname) {
case IPV6_ADDRFORM:
if (sk->protocol != IPPROTO_UDP &&
sk->protocol != IPPROTO_TCP)
return -EINVAL;
if (sk->state != TCP_ESTABLISHED)
return -ENOTCONN;
val = sk->family;
break;
case IPV6_PKTOPTIONS: case IPV6_PKTOPTIONS:
{ {
struct msghdr msg; struct msghdr msg;
......
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