nfsd: use correct byte order on rdma port.
Subsystems (2)
PATCH 1/1 nfsd: use correct byte order on rdma port.
The returned port from getservbyname() is in network order. Convert the port to host order before writing it to the portlist file.
--- utils/nfsd/nfssvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
utils/nfsd/nfssvc.c +1 -1
@@ -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 );
Signature · 1 line
2.5.0
Quoted 6 lines · Steve Dickson
The returned port from
getservbyname()is in
network order. Convert the port to host order
before writing it to the portlist file.
/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.
Quoted 26 lines
Reported-by Chuck Lever <[email protected]>Signed-off-by Steve Dickson <[email protected]>---
utils/nfsd/nfssvc.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)utils/nfsd/nfssvc.c +1
-1@@ -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 );Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Chuck Lever
Tom Talpey
reviewerQuoted 9 lines · Chuck Lever
Quoted 6 lines · Steve Dickson
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 <[email protected]>
Quoted 8 lines
/etc/serviceshas:nfsrdma 20049/tcp nfsrdma 20049/udp nfsrdma 20049/sctpwhich 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 RDMAnfsrdma 20049 udp Network File System (NFS)
[RFC5666]
over RDMAnfsrdma 20049 sctp Network File System (NFS)
[RFC5666]
over RDMAQuoted 45 lines
struct servent *sv = getservbyname("nfsrdma", "tcp");Is weird.
Quoted 22 lines
Reported-by Chuck Lever <[email protected]>Signed-off-by Steve Dickson <[email protected]>---
utils/nfsd/nfssvc.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)utils/nfsd/nfssvc.c +1
-2@@ -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
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Steve Dickson
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 <[email protected]>Signed-off-by Steve Dickson <[email protected]>
Committed..
steved.
Quoted 18 lines
--- utils/nfsd/nfssvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)utils/nfsd/nfssvc.c +1
-1@@ -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 );