* [PATCH] nfsd: use correct byte order on rdma port.
@ 2016-02-22 18:09 Steve Dickson
2016-02-22 18:33 ` Chuck Lever
2016-03-01 17:30 ` Steve Dickson
0 siblings, 2 replies; 4+ messages in thread
From: Steve Dickson @ 2016-02-22 18:09 UTC (permalink / raw)
To: Linux NFS Mailing list
The returned port from getservbyname() is in
network order. Convert the port to host order
before writing it to the portlist file.
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nfsd: use correct byte order on rdma port.
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
2016-03-01 17:30 ` Steve Dickson
1 sibling, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2016-02-22 18:33 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing List
> 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.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfsd: use correct byte order on rdma port.
2016-02-22 18:33 ` Chuck Lever
@ 2016-02-22 18:46 ` Tom Talpey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Talpey @ 2016-02-22 18:46 UTC (permalink / raw)
To: Chuck Lever, Steve Dickson; +Cc: Linux NFS Mailing List
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
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfsd: use correct byte order on rdma port.
2016-02-22 18:09 [PATCH] nfsd: use correct byte order on rdma port Steve Dickson
2016-02-22 18:33 ` Chuck Lever
@ 2016-03-01 17:30 ` Steve Dickson
1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2016-03-01 17:30 UTC (permalink / raw)
To: Linux NFS Mailing list
On 02/22/2016 01:09 PM, Steve Dickson wrote:
> The returned port from getservbyname() is in
> network order. Convert the port to host order
> before writing it to the portlist file.
>
> Reported-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed..
steved.
> ---
> 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);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-01 17:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-03-01 17:30 ` Steve Dickson
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.