From 7c6b07ca757799e71333496429475072c809f2fa Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Sat, 11 Jun 2011 04:09:05 -0400 Subject: [PATCH] Tweak the minimum dhcp packet size to at least include the magic cookie field. In practice, packets lacking any options at all are still invalid, but they will fail later in the validation, so that is fine. --- ndhc/packet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ndhc/packet.c b/ndhc/packet.c index 88fc2f6..387a4b4 100644 --- a/ndhc/packet.c +++ b/ndhc/packet.c @@ -1,5 +1,5 @@ /* packet.c - send and react to DHCP message packets - * Time-stamp: <2011-06-10 13:56:28 njk> + * Time-stamp: <2011-06-11 04:07:56 njk> * * (c) 2004-2011 Nicholas J. Kain * (c) 2001 Russ Dill @@ -328,8 +328,8 @@ void handle_packet(struct client_state_t *cs) if (len < 0) return; - if (len < 32) { - log_line("Received DHCP packet with less than 32 chars -- ignoring"); + if (len < DHCP_SIZE - 308) { + log_line("Packet is too short to contain magic cookie -- ignoring"); return; }