Fixed bug where UDP was required to mount a TCP NFS filesystem.

Submitted by:	Ken Hornstein, Sept.'94
This commit is contained in:
David Greenman 1995-05-24 10:10:24 +00:00
parent bef6490904
commit a2d169021d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8723

View File

@ -522,15 +522,19 @@ getnfsargs(spec, nfsargsp)
saddr.sin_family = AF_INET;
saddr.sin_port = htons(PMAPPORT);
if ((tport = pmap_getport(&saddr, RPCPROG_NFS,
NFS_VER2, IPPROTO_UDP)) == 0) {
NFS_VER2, nfsargsp->sotype == SOCK_STREAM ? IPPROTO_TCP :
IPPROTO_UDP)) == 0) {
if ((opflags & ISBGRND) == 0)
clnt_pcreateerror("NFS Portmap");
} else {
saddr.sin_port = 0;
pertry.tv_sec = 10;
pertry.tv_usec = 0;
if ((clp = clntudp_create(&saddr, RPCPROG_MNT,
RPCMNT_VER1, pertry, &so)) == NULL) {
if ((clp = (nfsargsp->sotype == SOCK_STREAM ?
clnttcp_create(&saddr, RPCPROG_MNT, RPCMNT_VER1,
&so, 0, 0) :
clntudp_create(&saddr, RPCPROG_MNT, RPCMNT_VER1,
pertry, &so))) == NULL) {
if ((opflags & ISBGRND) == 0)
clnt_pcreateerror("Cannot MNT RPC");
} else {