summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--support/include/nfsrpc.h6
-rw-r--r--support/nfs/getport.c25
2 files changed, 31 insertions, 0 deletions
diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h
index 6ebefca..d50fe94 100644
--- a/support/include/nfsrpc.h
+++ b/support/include/nfsrpc.h
@@ -27,6 +27,12 @@
#include <rpc/clnt.h>
/*
+ * IANA does not define an IP protocol number for RDMA transports.
+ * Choose an arbitrary value we can use locally.
+ */
+#define NFSPROTO_RDMA (3939)
+
+/*
* Conventional RPC program numbers
*/
#ifndef RPCBPROG
diff --git a/support/nfs/getport.c b/support/nfs/getport.c
index c930539..d74400b 100644
--- a/support/nfs/getport.c
+++ b/support/nfs/getport.c
@@ -216,6 +216,21 @@ nfs_get_proto(const char *netid, sa_family_t *family, unsigned long *protocol)
struct netconfig *nconf;
struct protoent *proto;
+ /*
+ * IANA does not define a protocol number for rdma netids,
+ * since "rdma" is not an IP protocol.
+ */
+ if (strcmp(netid, "rdma") == 0) {
+ *family = AF_INET;
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ }
+ if (strcmp(netid, "rdma6") == 0) {
+ *family = AF_INET6;
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ }
+
nconf = getnetconfigent(netid);
if (nconf == NULL)
return 0;
@@ -242,6 +257,16 @@ nfs_get_proto(const char *netid, sa_family_t *family, unsigned long *protocol)
{
struct protoent *proto;
+ /*
+ * IANA does not define a protocol number for rdma netids,
+ * since "rdma" is not an IP protocol.
+ */
+ if (strcmp(netid, "rdma") == 0) {
+ *family = AF_INET;
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ }
+
proto = getprotobyname(netid);
if (proto == NULL)
return 0;