diff options
| author | Roy Marples <roy@marples.name> | 2008-05-15 12:32:27 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-05-15 12:32:27 +0000 |
| commit | fe965fea17d9bb66994df6c10785b3f3d148d270 (patch) | |
| tree | 80819189846589a453a423a494509ceeccfba1b9 /bpf.c | |
| parent | 2eebbca565e80370d617f7c325510f7c29811693 (diff) | |
| download | dhcpcd-fe965fea17d9bb66994df6c10785b3f3d148d270.tar.xz | |
Fix bpf for the correct position on new buffers.
Diffstat (limited to 'bpf.c')
| -rw-r--r-- | bpf.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -92,7 +92,7 @@ open_socket(struct interface *iface, int protocol) /* Get the required BPF buffer length from the kernel. */ if (ioctl(fd, BIOCGBLEN, &buf_len) == -1) goto eexit; - if (iface->buffer_size != buf_len) { + if (iface->buffer_size != (size_t)buf_len) { free(iface->buffer); iface->buffer_size = buf_len; iface->buffer = xmalloc(buf_len); @@ -172,6 +172,7 @@ get_packet(struct interface *iface, void *data, ssize_t len) else if ((size_t)bytes < sizeof(packet)) return -1; iface->buffer_len = bytes; + iface->buffer_pos = 0; } bytes = -1; memcpy(&packet, iface->buffer + iface->buffer_pos, |
