From: Greg Banks <gnb@sgi.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: bfields@fieldses.org, neilb@suse.de, nfs@lists.sourceforge.net
Subject: Re: [RFC,PATCH] svc: REPOST - Fix the UDP address logic
Date: Thu, 25 Oct 2007 11:56:58 +1000 [thread overview]
Message-ID: <20071025015658.GA30105@sgi.com> (raw)
In-Reply-To: <471F8F27.1040008@oracle.com>
On Wed, Oct 24, 2007 at 02:29:59PM -0400, Chuck Lever wrote:
> Tom Tucker wrote:
> >
> >+static size_t svc_sockaddr_len(struct sockaddr *addr)
> >+{
> >+ switch (addr->sa_family) {
> >+ case AF_INET:
> >+ return sizeof(struct sockaddr_in);
> >+ case AF_INET6:
> >+ return sizeof(struct sockaddr_in6);
> >+ }
> >+ dprintk("svc: unrecognized address family %d\n", addr->sa_family);
> >+ return -ENOTSUPP;
> >+}
> >+
>
> Nit: sa_family is probably an unsigned short, so use "%u" instead of
> "%d". Also I'm using -EAFNOSUPPORT in similar error cases, but I may
> have missed a stated preference.
EAFNOSUPPORT is the most appropriate error.
Also, you might want to make the return the signed ssize_t so that
the return value -EAFNOSUPPORT is actually negative.
Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
Apparently, I'm Bedevere. Which MPHG character are you?
I don't speak for SGI.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
prev parent reply other threads:[~2007-10-25 1:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-23 18:13 [RFC,PATCH] svc: REPOST - Fix the UDP address logic Tom Tucker
2007-10-24 18:29 ` Chuck Lever
2007-10-24 18:46 ` Tom Tucker
2007-10-25 1:56 ` Greg Banks [this message]
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=20071025015658.GA30105@sgi.com \
--to=gnb@sgi.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox