diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | utils/statd/rmtcall.c | 10 | ||||
-rw-r--r-- | utils/statd/svc_run.c | 4 |
3 files changed, 20 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2004-12-07 Marc Eshel <eshel@almaden.ibm.com> + * utils/statd/svc_run.c(my_svc_run): allow loop to exit when in + MODE_NOTIFY_ONLY + *utils/statd/rmtcall.c(statd_get_socket): if a hostname is given + to statd with -n, prefer it's IP address to the default for + listening on. + 2004-12-06 Bruce Allan <bwa@us.ibm.com> * utils/mountd/auth.c(auth_reload) Clear the "my_client" cache on an auth_reload to avoid old data getting used. diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index 911a932..f6798f9 100644 --- a/utils/statd/rmtcall.c +++ b/utils/statd/rmtcall.c @@ -66,6 +66,16 @@ statd_get_socket(int port) memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_port = port; + /* + * If a local hostname is given (-n option to statd), bind to the address + * specified. This is required to support clients that ignore the mon_name in + * the statd protocol but use the source address from the request packet. + */ + if (MY_NAME) { + struct hostent *hp = gethostbyname(MY_NAME); + if (hp) + sin.sin_addr = *(struct in_addr *) hp->h_addr; + } if (bindresvport(sockfd, &sin) < 0) { dprintf(N_WARNING, "process_hosts: can't bind to reserved port\n"); diff --git a/utils/statd/svc_run.c b/utils/statd/svc_run.c index e2d7c97..7b69dc8 100644 --- a/utils/statd/svc_run.c +++ b/utils/statd/svc_run.c @@ -107,7 +107,9 @@ my_svc_run(void) tv.tv_sec); selret = select(FD_SETSIZE, &readfds, (void *) 0, (void *) 0, &tv); - } else { + } else if (run_mode & MODE_NOTIFY_ONLY) + return; + else { dprintf(N_DEBUG, "Waiting for client connections."); selret = select(FD_SETSIZE, &readfds, (void *) 0, (void *) 0, (struct timeval *) 0); |