116 |
argument is either "tcp" or "udp" Thus, is this backwards |
argument is either "tcp" or "udp" Thus, is this backwards |
117 |
(as service_name suggests)? If so, should it read: |
(as service_name suggests)? If so, should it read: |
118 |
s = getservbyname (pmap_service_name, "udp"); |
s = getservbyname (pmap_service_name, "udp"); |
119 |
or is there something I am missing here? */ |
or is there something I am missing here? */ |
120 |
s = getservbyname ("sunrpc", pmap_service_name); |
s = getservbyname ("sunrpc", pmap_service_name); |
121 |
if (s) |
if (s) |
122 |
pmapport = s->s_port; |
pmapport = s->s_port; |
158 |
return 0; |
return 0; |
159 |
} |
} |
160 |
|
|
161 |
*p++ = htonl (MOUNTPROG); |
*(p++) = htonl (MOUNTPROG); |
162 |
*p++ = htonl (MOUNTVERS); |
*(p++) = htonl (MOUNTVERS); |
163 |
*p++ = htonl (IPPROTO_UDP); |
*(p++) = htonl (IPPROTO_UDP); |
164 |
*p++ = htonl (0); |
*(p++) = htonl (0); |
165 |
err = conduct_rpc (&rpcbuf, &p); |
err = conduct_rpc (&rpcbuf, &p); |
166 |
if (!err) |
if (!err) |
167 |
{ |
{ |
168 |
port = ntohl (*p++); |
port = ntohl (*p); |
169 |
|
p++; |
170 |
addr.sin_port = htons (port); |
addr.sin_port = htons (port); |
171 |
} |
} |
172 |
else if (mount_port) |
else if (mount_port) |
205 |
/* XXX Protocol spec says this should be a "unix error code"; we'll |
/* XXX Protocol spec says this should be a "unix error code"; we'll |
206 |
pretend that an NFS error code is what's meant; the numbers match |
pretend that an NFS error code is what's meant; the numbers match |
207 |
anyhow. */ |
anyhow. */ |
208 |
err = nfs_error_trans (htonl (*p++)); |
err = nfs_error_trans (htonl (*p)); |
209 |
|
p++; |
210 |
if (err) |
if (err) |
211 |
{ |
{ |
212 |
error (0, err, name); |
error (0, err, name); |
237 |
error (0, errno, "rpc"); |
error (0, errno, "rpc"); |
238 |
goto error_with_rpcbuf; |
goto error_with_rpcbuf; |
239 |
} |
} |
240 |
*p++ = htonl (NFS_PROGRAM); |
*(p++) = htonl (NFS_PROGRAM); |
241 |
*p++ = htonl (NFS_VERSION); |
*(p++) = htonl (NFS_VERSION); |
242 |
*p++ = htonl (IPPROTO_UDP); |
*(p++) = htonl (IPPROTO_UDP); |
243 |
*p++ = htonl (0); |
*(p++) = htonl (0); |
244 |
err = conduct_rpc (&rpcbuf, &p); |
err = conduct_rpc (&rpcbuf, &p); |
245 |
if (!err) |
if (!err) |
246 |
port = ntohl (*p++); |
{ |
247 |
|
port = ntohl (*p); |
248 |
|
p++; |
249 |
|
} |
250 |
else if (nfs_port) |
else if (nfs_port) |
251 |
port = nfs_port; |
port = nfs_port; |
252 |
else |
else |