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

Submitted by:	Ken Hornstein, Sept.'94
This commit is contained in:
dg 1995-05-24 10:10:24 +00:00
parent 744d6a5236
commit e4beea5b47

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 {