X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fnfs%2Fgetport.c;h=3331ad4beda75af72a256a578456c3b3212ef326;hb=bc3c8b3496598b6f7a2d0692f3351c3704cb4b9d;hp=c9305397680e46859362ff8114aa2075f2efdbf0;hpb=f0d3a4bedccca7cce48296757bc1c8bd59b80828;p=nfs-utils.git diff --git a/support/nfs/getport.c b/support/nfs/getport.c index c930539..3331ad4 100644 --- a/support/nfs/getport.c +++ b/support/nfs/getport.c @@ -17,8 +17,8 @@ * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA. + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA * */ @@ -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;