From: Roy Marples Date: Mon, 20 Jan 2014 16:16:54 +0000 (+0000) Subject: Fix payload address calculation. X-Git-Tag: v6.3.0~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8624f0da19e40bc39393b50db104ddc13149b6e;p=thirdparty%2Fdhcpcd.git Fix payload address calculation. Thanks to Sebastian Huber. --- diff --git a/bpf.c b/bpf.c index 67fd5056..59d17d92 100644 --- a/bpf.c +++ b/bpf.c @@ -197,7 +197,8 @@ ipv4_getrawpacket(struct interface *ifp, int protocol, if (state->buffer_pos + packet.bh_caplen + packet.bh_hdrlen > state->buffer_len) goto next; /* Packet beyond buffer, drop. */ - payload = state->buffer + packet.bh_hdrlen + ETHER_HDR_LEN; + payload = state->buffer + state->buffer_pos + + packet.bh_hdrlen + ETHER_HDR_LEN; bytes = packet.bh_caplen - ETHER_HDR_LEN; if (bytes > len) bytes = len;