summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2007-01-06 23:21:08 +0000
committerkrw <krw@openbsd.org>2007-01-06 23:21:08 +0000
commit644708312c1cb0241a0c281f013cf0738ab230ba (patch)
tree95e9eb727bd448821ed6abd82f16033832e97773
parentsync (diff)
downloadwireguard-openbsd-644708312c1cb0241a0c281f013cf0738ab230ba.tar.xz
wireguard-openbsd-644708312c1cb0241a0c281f013cf0738ab230ba.zip
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.c4
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