aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1998-04-06 10:58:15 +0000
committerH. Peter Anvin <hpa@zytor.com>1998-04-06 10:58:15 +0000
commit9e99f65aa4f9aa1ce00640e8ceb051f8680fbb03 (patch)
tree267408747555cd810371f36e84539d9a48ac2e63 /modules
parenta26437c85b4da8c6e2bf88c7aedfb233a3c77c1a (diff)
downloadautofs3-9e99f65aa4f9aa1ce00640e8ceb051f8680fbb03.tar.gz
autofs3-9e99f65aa4f9aa1ce00640e8ceb051f8680fbb03.tar.xz
autofs3-9e99f65aa4f9aa1ce00640e8ceb051f8680fbb03.zip
Update the documentation slightly. Make the locality detector not fail
gratuitously.
Diffstat (limited to 'modules')
-rw-r--r--modules/mount_nfs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
index e9b4ee4..a3adbb3 100644
--- a/modules/mount_nfs.c
+++ b/modules/mount_nfs.c
@@ -120,13 +120,16 @@ int mount_mount(const char *root, const char *name, int name_len,
return 1;
}
saddr.sin_family = AF_INET;
- bcopy(*haddr, &saddr.sin_addr, he->h_length);
+ memcpy(&saddr.sin_addr, *haddr, he->h_length);
saddr.sin_port = port_discard;
len = sizeof(laddr);
- if ( connect(sock, (struct sockaddr *) &saddr, sizeof(saddr)) < 0
- || getsockname(sock, (struct sockaddr *) &laddr, &len) < 0 ) {
- syslog(LOG_ERR, MODPREFIX "connect+getsockname failed for %s", name);
+
+ if ( connect(sock, (struct sockaddr *) &saddr, sizeof(saddr)) < 0 )
+ continue; /* Assume it wasn't local */
+
+ if ( getsockname(sock, (struct sockaddr *) &laddr, &len) < 0 ) {
+ syslog(LOG_ERR, MODPREFIX "getsockname failed for %s: %m", name);
close(sock);
return 1;
}