diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-19 15:52:21 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-19 15:52:21 +0000 |
commit | f23239f1abfa1631368d1a24e7349bba9d3d5cd0 (patch) | |
tree | b737663062fc06b5b2ef5c83ff81880f30ccf79a /usr.sbin | |
parent | 45eebcbcf7d435b82ecc3ab8927332beb114f00a (diff) |
Make sure bufix is updated after copying options into the first overflow
buffer. Actually use the second overflow buffer now that bufix is correct
and the test for remaining options will work correctly.
ok beck@
Diffstat (limited to 'usr.sbin')
-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); |