diff options
author | Steve Dickson <steved@redhat.com> | 2009-10-17 09:26:18 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-10-22 15:34:48 -0400 |
commit | a8b90e8f64a7d53b20c0980f2a6d9a8d5945bcc4 (patch) | |
tree | 0b002b3b21146ef5c335b2249114953fdffcbcca /utils/mount/network.c | |
parent | 2f61f62ac777cc03e30513f6fd3699f9e2f04e27 (diff) | |
download | nfs-utils-a8b90e8f64a7d53b20c0980f2a6d9a8d5945bcc4.tar.gz nfs-utils-a8b90e8f64a7d53b20c0980f2a6d9a8d5945bcc4.tar.xz nfs-utils-a8b90e8f64a7d53b20c0980f2a6d9a8d5945bcc4.zip |
Use the default protocol and version values, when they
are set in the configuration file, to start the negation
with the server
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r-- | utils/mount/network.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c index 1a05351..e651167 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -50,6 +50,7 @@ #include "nfsrpc.h" #include "parse_opt.h" #include "network.h" +#include "conffile.h" #define PMAP_TIMEOUT (10) #define CONNECT_TIMEOUT (20) @@ -609,10 +610,19 @@ static int nfs_probe_nfsport(const struct sockaddr *sap, const socklen_t salen, if (pmap->pm_vers && pmap->pm_prot && pmap->pm_port) return 1; - if (nfs_mount_data_version >= 4) + if (nfs_mount_data_version >= 4) { + const unsigned int *probe_proto = probe_tcp_first; + + /* + * If the default proto has been set and + * its not TCP, start with UDP + */ + if (config_default_proto && config_default_proto != IPPROTO_TCP) + probe_proto = probe_udp_first; + return nfs_probe_port(sap, salen, pmap, - probe_nfs3_first, probe_tcp_first); - else + probe_nfs3_first, probe_proto); + } else return nfs_probe_port(sap, salen, pmap, probe_nfs2_only, probe_udp_only); } |