diff options
-rw-r--r-- | usr.sbin/dhcpd/options.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/options.c b/usr.sbin/dhcpd/options.c index fc99d2a215e..112900f4816 100644 --- a/usr.sbin/dhcpd/options.c +++ b/usr.sbin/dhcpd/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.13 2007/10/19 15:43:33 krw Exp $ */ +/* $OpenBSD: options.c,v 1.14 2007/10/19 15:52:20 krw Exp $ */ /* DHCP options parsing and reassembly. */ @@ -328,6 +328,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, memcpy(outpacket->file, &buffer[bufix], option_size - bufix); mainbufix = option_size - bufix; + bufix = option_size; if (mainbufix < DHCP_FILE_LEN) outpacket->file[mainbufix++] = (char)DHO_END; } else { @@ -336,7 +337,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, bufix += DHCP_FILE_LEN; } } - if ((overload & 2) && option_size < bufix) { + if ((overload & 2) && option_size > bufix) { memcpy(outpacket->sname, &buffer[bufix], option_size - bufix); |