diff options
Diffstat (limited to 'usr.sbin/ypbind')
-rw-r--r-- | usr.sbin/ypbind/ypbind.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index a3a7dc3..0083cf8 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -116,6 +116,9 @@ int ypsetmode = YPSET_NO; int ypsecuremode = 0; int ppid; +#define NOT_RESPONDING_HYSTERESIS 10 +static int not_responding_count = 0; + /* * Special restricted mode variables: when in restricted mode, only the * specified restricted_domain will be bound, and only the servers listed @@ -654,9 +657,13 @@ broadcast(struct _dom_binding *ypdb) return; } - if (ypdb->dom_vers == -1 && (long)ypdb->dom_server_addr.sin_addr.s_addr) - syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" not responding", - inet_ntoa(ypdb->dom_server_addr.sin_addr), ypdb->dom_domain); + if (ypdb->dom_vers == -1 && (long)ypdb->dom_server_addr.sin_addr.s_addr) { + if (not_responding_count++ >= NOT_RESPONDING_HYSTERESIS) { + not_responding_count = NOT_RESPONDING_HYSTERESIS; + syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" not responding", + inet_ntoa(ypdb->dom_server_addr.sin_addr), ypdb->dom_domain); + } + } broad_domain = ypdb; flock(ypdb->dom_lockfd, LOCK_UN); @@ -886,9 +893,13 @@ rpc_received(char *dom, struct sockaddr_in *raddrp, int force) } /* We've recovered from a crash: inform the world. */ - if (ypdb->dom_vers == -1 && ypdb->dom_server_addr.sin_addr.s_addr) - syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" OK", - inet_ntoa(raddrp->sin_addr), ypdb->dom_domain); + if (ypdb->dom_vers == -1 && ypdb->dom_server_addr.sin_addr.s_addr) { + if (not_responding_count >= NOT_RESPONDING_HYSTERESIS) { + not_responding_count = 0; + syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" OK", + inet_ntoa(raddrp->sin_addr), ypdb->dom_domain); + } + } bcopy(raddrp, &ypdb->dom_server_addr, sizeof ypdb->dom_server_addr); |