diff options
| author | Roy Marples <roy@marples.name> | 2009-01-29 13:56:12 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-01-29 13:56:12 +0000 |
| commit | c7c74f121b85ce297fe1e836058baa605141636c (patch) | |
| tree | f1125c3e8aa425fea2a15fcccc76bf0af6047d87 | |
| parent | 2f0898a29aec284e0885e7b96a9f3f12908bdcfb (diff) | |
| download | dhcpcd-c7c74f121b85ce297fe1e836058baa605141636c.tar.xz | |
Just terminate the DHCP message if not terminated. DHO_PAD could be valid data.
| -rw-r--r-- | client.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1581,10 +1581,8 @@ handle_dhcp_packet(struct if_state *state, const struct options *options) } /* We should ensure that the packet is terminated correctly * if we have space for the terminator */ - if ((size_t)bytes < sizeof(struct dhcp_message)) { - p = (uint8_t *)dhcp + bytes - 1; - while (p > dhcp->options && *p == DHO_PAD) - p--; + if ((size_t)bytes != sizeof(*dhcp)) { + p = (uint8_t *)dhcp + (bytes - 1); if (*p != DHO_END) *++p = DHO_END; } |
