From d47e7220ac5fe649e85b7a50276b11da1815944f Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 8 Jan 2007 02:51:14 +0000 Subject: Initialize incoming packet buffer with DHO_END (0xff) rather than DHO_PAD (0x00) so that option scanning will terminate on hitting initialized data rather than scanning and ignoring trailing DHO_PAD characters. Suggested by & ok stevesk --- sbin/dhclient/bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin/dhclient/bpf.c') diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index 4129c34b756..90e2326cd55 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.19 2007/01/04 22:30:57 krw Exp $ */ +/* $OpenBSD: bpf.c,v 1.20 2007/01/08 02:51:13 krw Exp $ */ /* BPF socket interface code, originally contributed by Archie Cobbs. */ @@ -394,7 +394,7 @@ receive_packet(struct sockaddr_in *from, struct hardware *hfrom) } /* Copy out the data in the packet... */ - bzero(&client->packet, sizeof(client->packet)); + memset(&client->packet, DHO_END, sizeof(client->packet)); memcpy(&client->packet, ifi->rbuf + ifi->rbuf_offset, hdr.bh_caplen); ifi->rbuf_offset = BPF_WORDALIGN(ifi->rbuf_offset + -- cgit v1.2.3