All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Talpey <tom@talpey.com>
To: Chuck Lever <chuck.lever@oracle.com>, Steve Dickson <SteveD@redhat.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfsd: use correct byte order on rdma port.
Date: Mon, 22 Feb 2016 10:46:30 -0800	[thread overview]
Message-ID: <56CB5786.9070508@talpey.com> (raw)
In-Reply-To: <34C24F04-CBFE-4226-8D7E-F4F526F1C661@oracle.com>

On 2/22/2016 10:33 AM, Chuck Lever wrote:
>
>> On Feb 22, 2016, at 1:09 PM, Steve Dickson <SteveD@redhat.com> wrote:
>>
>> The returned port from getservbyname() is in
>> network order. Convert the port to host order
>> before writing it to the portlist file.
>
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
>
> /etc/services has:
>
> nfsrdma    20049/tcp
> nfsrdma    20049/udp
> nfsrdma    20049/sctp
>
> which RFC 5666 defines, but I couldn't find in the
> IANA protocols registry.

They're there:

http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt

nfsrdma            20049       tcp    Network File System (NFS) 
 
                                                               [RFC5666]
                                       over RDMA
nfsrdma            20049       udp    Network File System (NFS) 
 
                                                               [RFC5666]
                                       over RDMA
nfsrdma            20049      sctp    Network File System (NFS) 
 
                                                               [RFC5666]
                                       over RDMA


>
>   struct servent *sv = getservbyname("nfsrdma", "tcp");
>
> Is weird.
>
>
>> Reported-by: Chuck Lever <chuck.lever@oracle.com>
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>> utils/nfsd/nfssvc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
>> index e8efd06..dcb430a 100644
>> --- a/utils/nfsd/nfssvc.c
>> +++ b/utils/nfsd/nfssvc.c
>> @@ -282,7 +282,7 @@ nfssvc_set_rdmaport(const char *port)
>> 	int fd;
>>
>> 	if (sv)
>> -		nport = sv->s_port;
>> +		nport = ntohs(sv->s_port);
>> 	else {
>> 		char *ep;
>> 		nport = strtol(port, &ep, 10);
>> --
>> 2.5.0
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
> Chuck Lever
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

  reply	other threads:[~2016-02-22 18:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 18:09 [PATCH] nfsd: use correct byte order on rdma port Steve Dickson
2016-02-22 18:33 ` Chuck Lever
2016-02-22 18:46   ` Tom Talpey [this message]
2016-03-01 17:30 ` Steve Dickson

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=56CB5786.9070508@talpey.com \
    --to=tom@talpey.com \
    --cc=SteveD@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.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.