diff options
| author | Roy Marples <roy@marples.name> | 2008-03-30 08:26:34 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-03-30 08:26:34 +0000 |
| commit | 0a204e3b9886bd2a88084a5d5796a997ca610c84 (patch) | |
| tree | cc5383ddb4f49e86595f5820da51d995d98e4ef9 /bpf.c | |
| parent | f828cecf36a0b8457546b09963d16e192e5936e4 (diff) | |
| download | dhcpcd-0a204e3b9886bd2a88084a5d5796a997ca610c84.tar.xz | |
Pointless looping in bpf.packet, as pointed out by D. Young.
Diffstat (limited to 'bpf.c')
| -rw-r--r-- | bpf.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; |
