aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2001-08-24 14:52:38 +0000
committerBrian Somers <brian@FreeBSD.org>2001-08-24 14:52:38 +0000
commit321d268b287854f14779055b3a7ca8fc28b09de1 (patch)
tree546e49799b4e1831231076f91f31f89b90b958ca /libexec
parentfd048a1c8a416a81c90fa5c3b0ef5c9530569a88 (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/pppoed/pppoed.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libexec/pppoed/pppoed.c b/libexec/pppoed/pppoed.c
index ce50ee4164520..a3c6d375ac794 100644
--- a/libexec/pppoed/pppoed.c
+++ b/libexec/pppoed/pppoed.c
@@ -141,7 +141,7 @@ ConfigureNode(const char *prog, const char *iface, const char *provider,
/* Get our list back */
resp = (struct ng_mesg *)rbuf;
- if (NgRecvMsg(cs, resp, sizeof rbuf, NULL) < 0) {
+ if (NgRecvMsg(cs, resp, sizeof rbuf, NULL) <= 0) {
perror("Cannot get netgraph response");
return EX_UNAVAILABLE;
}
@@ -359,11 +359,17 @@ Spawn(const char *prog, const char *acname, const char *provider,
syslog(LOG_INFO, "Waiting for a SUCCESS reply %s", path);
do {
- if (NgRecvMsg(cs, rep, sizeof msgbuf, NULL) < 0) {
+ if ((ret = NgRecvMsg(cs, rep, sizeof msgbuf, NULL) < 0)) {
syslog(LOG_ERR, "%s: Cannot receive a message: %m", path);
_exit(EX_OSERR);
}
+ if (ret == 0) {
+ /* The socket has been closed */
+ syslog(LOG_INFO, "%s: Client timed out", path);
+ _exit(EX_TEMPFAIL);
+ }
+
if (rep->header.version != NG_VERSION) {
syslog(LOG_ERR, "%ld: Unexpected netgraph version, expected %ld",
(long)rep->header.version, (long)NG_VERSION);