netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.9] address family not supported for sendmsg()
@ 2004-10-22  4:27 Suresh Krishnan
  2004-10-22  5:58 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Suresh Krishnan @ 2004-10-22  4:27 UTC (permalink / raw)
  To: davem, netdev

When sendmsg() encounters an unsupported address family
it must return EAFNOSUPPORT. It currently returns EINVAL,
which must be returned only when the sum of the iov_len 
values overflows a ssize_t.

Signed-off-by: Suresh Krishnan <suresh.krishnan@ericsson.ca>
---

diff -Nur linux-2.6.9/net/ipv4/raw.c linux-2.6.9-patched/net/ipv4/raw.c
--- linux-2.6.9/net/ipv4/raw.c  2004-10-18 17:54:31.000000000 -0400
+++ linux-2.6.9-patched/net/ipv4/raw.c  2004-10-21 16:38:15.000000000 -0400
@@ -407,7 +407,7 @@
                                printk(KERN_INFO "%s forgot to set AF_INET in "
                                                 "raw sendmsg. Fix it!\n",
                                                 current->comm);
-                       err = -EINVAL;
+                       err = -EAFNOSUPPORT;
                        if (usin->sin_family)
                                goto out;
                }
diff -Nur linux-2.6.9/net/ipv4/udp.c linux-2.6.9-patched/net/ipv4/udp.c
--- linux-2.6.9/net/ipv4/udp.c  2004-10-18 17:53:22.000000000 -0400
+++ linux-2.6.9-patched/net/ipv4/udp.c  2004-10-21 16:37:40.000000000 -0400
@@ -531,7 +531,7 @@
                        return -EINVAL;
                if (usin->sin_family != AF_INET) {
                        if (usin->sin_family != AF_UNSPEC)
-                               return -EINVAL;
+                               return -EAFNOSUPPORT;
                }

                daddr = usin->sin_addr.s_addr;
diff -Nur linux-2.6.9/net/ipv6/raw.c linux-2.6.9-patched/net/ipv6/raw.c
--- linux-2.6.9/net/ipv6/raw.c  2004-10-18 17:53:51.000000000 -0400
+++ linux-2.6.9-patched/net/ipv6/raw.c  2004-10-21 16:38:00.000000000 -0400
@@ -639,7 +639,7 @@
                        return -EINVAL;

                if (sin6->sin6_family && sin6->sin6_family != AF_INET6)
-                       return(-EINVAL);
+                       return(-EAFNOSUPPORT);

                /* port is the proto value [0..255] carried in nexthdr */
                proto = ntohs(sin6->sin6_port);
diff -Nur linux-2.6.9/net/ipv6/udp.c linux-2.6.9-patched/net/ipv6/udp.c
--- linux-2.6.9/net/ipv6/udp.c  2004-10-18 17:54:55.000000000 -0400
+++ linux-2.6.9-patched/net/ipv6/udp.c  2004-10-21 16:37:52.000000000 -0400
@@ -699,7 +699,7 @@
                if (likely(up->pending)) {
                        if (unlikely(up->pending != AF_INET6)) {
                                release_sock(sk);
-                               return -EINVAL;
+                               return -EAFNOSUPPORT;
                        }
                        dst = NULL;
                        goto do_append_data;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-23  5:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-22  4:27 [PATCH 2.6.9] address family not supported for sendmsg() Suresh Krishnan
2004-10-22  5:58 ` David S. Miller
2004-10-22  6:30   ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-22  6:31     ` YOSHIFUJI Hideaki / 吉藤英明
2004-10-23  0:07       ` Suresh Krishnan
2004-10-23  5:29         ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).