summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-09-03 06:37:15 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-09-03 06:37:15 +0000
commitdf30e1acc83436bddaa61cba47a258d7d69e0f01 (patch)
tree20b7fb9f34f09b2db138a43ee0ffcb4a1404973b /usr.sbin
parentc3f89dac6ba5f9022d4dce34ee2bb2eb612577e3 (diff)
sleep instead of busy waiting on ENOBUFS. reduces cpu time.
pr3900. ok canacar@ deraadt@ matthieu@ millert@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pppoe/client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c
index 284700844b8..689a5078ec4 100644
--- a/usr.sbin/pppoe/client.c
+++ b/usr.sbin/pppoe/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.19 2004/06/14 19:22:39 canacar Exp $ */
+/* $OpenBSD: client.c,v 1.20 2004/09/03 06:37:14 tedu Exp $ */
/*
* Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net
@@ -368,8 +368,10 @@ getpackets(int bfd, u_int8_t *srv, u_int8_t *sysname,
goto next;
if ((r = bpf_to_ppp(pppfd, len, mpkt)) < 0)
return (-1);
- if (r == 0)
+ if (r == 0) {
+ usleep(100000);
continue;
+ }
}
next:
pkt += BPF_WORDALIGN(bh->bh_hdrlen + bh->bh_caplen);