Commit 6b26ab23 authored by Suresh Krishnan's avatar Suresh Krishnan Committed by David S. Miller

[NET]: Address family not supported for sendmsg()

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e3e9425c
...@@ -407,7 +407,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -407,7 +407,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
printk(KERN_INFO "%s forgot to set AF_INET in " printk(KERN_INFO "%s forgot to set AF_INET in "
"raw sendmsg. Fix it!\n", "raw sendmsg. Fix it!\n",
current->comm); current->comm);
err = -EINVAL; err = -EAFNOSUPPORT;
if (usin->sin_family) if (usin->sin_family)
goto out; goto out;
} }
......
...@@ -531,7 +531,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -531,7 +531,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
return -EINVAL; return -EINVAL;
if (usin->sin_family != AF_INET) { if (usin->sin_family != AF_INET) {
if (usin->sin_family != AF_UNSPEC) if (usin->sin_family != AF_UNSPEC)
return -EINVAL; return -EAFNOSUPPORT;
} }
daddr = usin->sin_addr.s_addr; daddr = usin->sin_addr.s_addr;
......
...@@ -639,7 +639,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -639,7 +639,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
return -EINVAL; return -EINVAL;
if (sin6->sin6_family && sin6->sin6_family != AF_INET6) if (sin6->sin6_family && sin6->sin6_family != AF_INET6)
return(-EINVAL); return(-EAFNOSUPPORT);
/* port is the proto value [0..255] carried in nexthdr */ /* port is the proto value [0..255] carried in nexthdr */
proto = ntohs(sin6->sin6_port); proto = ntohs(sin6->sin6_port);
......
...@@ -699,7 +699,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -699,7 +699,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if (likely(up->pending)) { if (likely(up->pending)) {
if (unlikely(up->pending != AF_INET6)) { if (unlikely(up->pending != AF_INET6)) {
release_sock(sk); release_sock(sk);
return -EINVAL; return -EAFNOSUPPORT;
} }
dst = NULL; dst = NULL;
goto do_append_data; goto do_append_data;
......
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