mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Fix a typo relating to the "-U" (force UDP for mount protocol)
option. When specified, make sure to use the correct netid for the getnetconfigent() call, and also in error messages.
This commit is contained in:
parent
370d222b7f
commit
ba33efd92c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75401
@ -771,16 +771,17 @@ nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai, char *hostp,
|
||||
}
|
||||
/* The RPCPROG_MNT netid may be different. */
|
||||
if (mnttcp_ok) {
|
||||
netid_mnt = netid;
|
||||
nconf_mnt = nconf;
|
||||
} else {
|
||||
netid_mnt = (ai->ai_family == AF_INET6) ? "udp6" : "udp";
|
||||
if ((nconf_mnt = getnetconfigent(netid)) == NULL) {
|
||||
snprintf(errbuf, sizeof errbuf, "%s: %s", netid,
|
||||
if ((nconf_mnt = getnetconfigent(netid_mnt)) == NULL) {
|
||||
snprintf(errbuf, sizeof errbuf, "%s: %s", netid_mnt,
|
||||
nc_sperror());
|
||||
return (TRYRET_LOCALERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tryagain:
|
||||
if (trymntmode == V2) {
|
||||
nfsvers = 2;
|
||||
@ -846,7 +847,7 @@ nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai, char *hostp,
|
||||
try.tv_usec = 0;
|
||||
clp = clnt_tp_create(hostp, RPCPROG_MNT, mntvers, nconf_mnt);
|
||||
if (clp == NULL) {
|
||||
snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
|
||||
snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
|
||||
hostp, spec, clnt_spcreateerror("RPCMNT: clnt_create"));
|
||||
return (returncode(rpc_createerr.cf_stat,
|
||||
&rpc_createerr.cf_error));
|
||||
@ -867,7 +868,7 @@ nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai, char *hostp,
|
||||
goto tryagain;
|
||||
}
|
||||
clnt_geterr(clp, &rpcerr);
|
||||
snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
|
||||
snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
|
||||
hostp, spec, clnt_sperror(clp, "RPCPROG_MNT"));
|
||||
clnt_destroy(clp);
|
||||
return (returncode(stat, &rpcerr));
|
||||
@ -875,7 +876,7 @@ nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai, char *hostp,
|
||||
clnt_destroy(clp);
|
||||
|
||||
if (nfhret.stat != 0) {
|
||||
snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
|
||||
snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
|
||||
hostp, spec, strerror(nfhret.stat));
|
||||
return (TRYRET_REMOTEERR);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user