diff options
| author | Roy Marples <roy@marples.name> | 2009-01-29 13:56:23 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-01-29 13:56:23 +0000 |
| commit | 4ac6a5d2f9b7955e9316cd85a9717132354f4423 (patch) | |
| tree | 495162a0b3386148f1926ab653b5ea8725cd0307 | |
| parent | 141c80922499959330d53f41f5f5a54e39bdb40c (diff) | |
| download | dhcpcd-4ac6a5d2f9b7955e9316cd85a9717132354f4423.tar.xz | |
Just terminate the DHCP message if not terminated. DHO_PAD could be valid data.
| -rw-r--r-- | dhcpcd.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -609,10 +609,8 @@ handle_dhcp_packet(void *arg) } /* 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; } |
