summaryrefslogtreecommitdiffstats
path: root/bpf.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-30 08:26:34 +0000
committerRoy Marples <roy@marples.name>2008-03-30 08:26:34 +0000
commit0a204e3b9886bd2a88084a5d5796a997ca610c84 (patch)
treecc5383ddb4f49e86595f5820da51d995d98e4ef9 /bpf.c
parentf828cecf36a0b8457546b09963d16e192e5936e4 (diff)
downloaddhcpcd-0a204e3b9886bd2a88084a5d5796a997ca610c84.tar.xz
Pointless looping in bpf.packet, as pointed out by D. Young.
Diffstat (limited to 'bpf.c')
-rw-r--r--bpf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bpf.c b/bpf.c
index 293f023c..5e978ecd 100644
--- a/bpf.c
+++ b/bpf.c
@@ -172,7 +172,7 @@ get_packet(const struct interface *iface, unsigned char *data,
} else
bpf.buffer += *buffer_pos;
- while (bpf.packet) {
+ do {
len = 0;
have_data = false;
@@ -211,10 +211,7 @@ get_packet(const struct interface *iface, unsigned char *data,
if (have_data)
return len;
-
- if (*buffer_pos == 0)
- break;
- }
+ } while (*buffer_pos);
/* No valid packets left, so return */
*buffer_pos = 0;