diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-06 23:21:09 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-06 23:21:09 +0000 |
commit | 4213d84cbcb473d6375e7011f8f1e33513cc3245 (patch) | |
tree | b6e5c1816a8f9000ce2ca816a09361bb6631fa2a | |
parent | 1ac3c2f63db6a70dc68a0b831be71ae6f0a26eaf (diff) |
Fix options parsing. Last commit lost the proper length of the
incoming packet. But since we bzero() the packet buffer before
copying the incoming data into it, and the options are at the end, and
we use a fixed sized buffer, and 0's are ignored as pad options, and
proper option lists end with 0xff, it's simplier to always try to scan
the whole buffer.
Problem found by, and patch tested by kettenis@.
-rw-r--r-- | sbin/dhclient/options.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c index 5ac02d8857a..2e2d57b4f34 100644 --- a/sbin/dhclient/options.c +++ b/sbin/dhclient/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.28 2007/01/04 22:17:48 krw Exp $ */ +/* $OpenBSD: options.c,v 1.29 2007/01/06 23:21:08 krw Exp $ */ /* DHCP options parsing and reassembly. */ @@ -70,7 +70,7 @@ parse_options(struct packet *packet) * the End field. */ parse_option_buffer(packet, &client->packet.options[4], - client->packet_length - DHCP_FIXED_NON_UDP - 4); + sizeof(client->packet.options) - 4); /* * If we parsed a DHCP Option Overload option, parse more |