diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-08 02:51:14 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-08 02:51:14 +0000 |
commit | d47e7220ac5fe649e85b7a50276b11da1815944f (patch) | |
tree | 6e8cf7222ad242e3f89492985cb6e4116b948654 /sbin/dhclient/bpf.c | |
parent | 304f793e93c1d8db59e5802f3c10d5fc684c8aca (diff) |
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
Diffstat (limited to 'sbin/dhclient/bpf.c')
-rw-r--r-- | sbin/dhclient/bpf.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 + |