diff options
Diffstat (limited to 'sbin/dhclient/bpf.c')
-rw-r--r-- | sbin/dhclient/bpf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index 03a56e8a444..2e6978c48b8 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.48 2017/04/18 13:44:03 krw Exp $ */ +/* $OpenBSD: bpf.c,v 1.49 2017/04/18 13:59:09 krw Exp $ */ /* BPF socket interface code, originally contributed by Archie Cobbs. */ @@ -397,7 +397,8 @@ receive_packet(struct interface_info *ifi, struct sockaddr_in *from, ifi->rbuf_offset += hdr.bh_hdrlen; /* Decode the physical header. */ - offset = decode_hw_header(ifi->rbuf, ifi->rbuf_offset, hfrom); + offset = decode_hw_header(ifi->rbuf + ifi->rbuf_offset, + hdr.bh_caplen, hfrom); /* * If a physical layer checksum failed (dunno of any @@ -413,8 +414,8 @@ receive_packet(struct interface_info *ifi, struct sockaddr_in *from, hdr.bh_caplen -= offset; /* Decode the IP and UDP headers. */ - offset = decode_udp_ip_header(ifi->rbuf, - ifi->rbuf_offset, from, hdr.bh_caplen); + offset = decode_udp_ip_header(ifi->rbuf + ifi->rbuf_offset, + hdr.bh_caplen, from); /* If the IP or UDP checksum was bad, skip the packet. */ if (offset < 0) { |