summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-10-09 22:49:44 +0000
committerbrian <brian@FreeBSD.org>2000-10-09 22:49:44 +0000
commit4d8e577298f9bc8ad1e6532666f73f64c8bd613f (patch)
tree7694ba57ed5d03e382cdd4de08992456c5944207
parent38c4d01137dc7f3cd19b75f9b4513c9bab16388e (diff)
downloadFreeBSD-src-4d8e577298f9bc8ad1e6532666f73f64c8bd613f.zip
FreeBSD-src-4d8e577298f9bc8ad1e6532666f73f64c8bd613f.tar.gz
If write() gives -1/ENOBUFS, keep the packet and sleep for 1/10th
of a second before attempting to write it again (unless there's something else to do instead).
-rw-r--r--usr.sbin/ppp/physical.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c
index e605131..c0979a9 100644
--- a/usr.sbin/ppp/physical.c
+++ b/usr.sbin/ppp/physical.c
@@ -408,12 +408,13 @@ physical_DescriptorWrite(struct fdescriptor *d, struct bundle *bundle,
p->out = m_free(p->out);
result = 1;
} else if (nw < 0) {
- if (errno != EAGAIN) {
+ if (errno == EAGAIN)
+ result = 1;
+ else if (errno != ENOBUFS) {
log_Printf(LogPHASE, "%s: write (%d): %s\n", p->link.name,
p->fd, strerror(errno));
datalink_Down(p->dl, CLOSE_NORMAL);
}
- result = 1;
}
/* else we shouldn't really have been called ! select() is broken ! */
}
OpenPOWER on IntegriCloud