X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fmount%2Fnetwork.c;h=9b6504d430b1b0be6dd8ad3672d4707690a44742;hb=c7427b57e2be8ef0d57ad0618d4590c062b130f5;hp=1759c1cdbc732b341494ee0b7f56aea77bc63e36;hpb=7e90281b88c05b01c61152b54a0cf2faec45b09c;p=nfs-utils.git diff --git a/utils/mount/network.c b/utils/mount/network.c index 1759c1c..9b6504d 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -210,9 +210,6 @@ int nfs_lookup(const char *hostname, const sa_family_t family, { struct addrinfo *gai_results; struct addrinfo gai_hint = { -#ifdef HAVE_DECL_AI_ADDRCONFIG - .ai_flags = AI_ADDRCONFIG, -#endif /* HAVE_DECL_AI_ADDRCONFIG */ .ai_family = family, }; socklen_t len = *salen; @@ -1349,7 +1346,7 @@ nfs_nfs_port(struct mount_options *options, unsigned long *port) case PO_NOT_FOUND: break; case PO_FOUND: - if (tmp >= 1 && tmp <= 65535) { + if (tmp >= 0 && tmp <= 65535) { *port = tmp; return 1; } @@ -1521,7 +1518,11 @@ nfs_mount_protocol(struct mount_options *options, unsigned long *protocol) * set @protocol to zero. The pmap protocol value will * be filled in later by an rpcbind query in this case. */ - return nfs_nfs_protocol(options, protocol); + if (!nfs_nfs_protocol(options, protocol)) + return 0; + if (*protocol == NFSPROTO_RDMA) + *protocol = IPPROTO_TCP; + return 1; } /* @@ -1537,7 +1538,7 @@ nfs_mount_port(struct mount_options *options, unsigned long *port) case PO_NOT_FOUND: break; case PO_FOUND: - if (tmp >= 1 && tmp <= 65535) { + if (tmp >= 0 && tmp <= 65535) { *port = tmp; return 1; }