+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.
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");
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);