All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ryan Hammonds <rhammonds-AMWTPT7kBHDQT0dZR+AlfA@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Possible Manpage bug for bind(2)
Date: Tue, 22 Jul 2014 07:40:15 +0200	[thread overview]
Message-ID: <53CDF93F.70202@gmail.com> (raw)
In-Reply-To: <CA+D=RwhXRWwfVoxKwEaqviET0bOGJ2wOE8qMbmZH7a3-Bd6xYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Ryan,

On 07/17/2014 07:39 PM, Ryan Hammonds wrote:
> Greetings,
> I'd like to point out an issue in the manpage for bind(2). My
> application is trying to bind an IPV4 UDP socket to an address. I've
> found that passing an invalid address length to bind() causes bind to
> return EINVAL. According to the bind(2) manpage, this should only
> occur when using unix domain sockets (which I am not). 

Yes, your report looks right to me. I applied the patch below.
Thanks for the report.


> This also
> makes me wonder if the current description (EINVAL = "the socket is
> already bound to an address") is correct in the first place.

A bit of light testing suggests that it is (still) correct.

Cheers,

Michael

--- a/man2/bind.2
+++ b/man2/bind.2
@@ -183,6 +183,12 @@ The socket is already bound to an address.
 .\" This may change in the future: see
 .\" .I linux/unix/sock.c for details.
 .TP
+.B EINVAL
+.I addrlen
+is wrong, or
+.I addr
+is not a valid address for this socket's domain.
+.TP
 .B ENOTSOCK
 .I sockfd
 is a descriptor for a file, not a socket.
@@ -204,13 +210,6 @@ address was not local.
 .I addr
 points outside the user's accessible address space.
 .TP
-.B EINVAL
-The
-.I addrlen
-is wrong, or the socket was not in the
-.B AF_UNIX
-family.
-.TP
 .B ELOOP
 Too many symbolic links were encountered in resolving
 .IR addr .

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

           reply	other threads:[~2014-07-22  5:40 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CA+D=RwhXRWwfVoxKwEaqviET0bOGJ2wOE8qMbmZH7a3-Bd6xYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53CDF93F.70202@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rhammonds-AMWTPT7kBHDQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.