diff options
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 656295ff7..5a1f8fd7a 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -606,7 +606,7 @@ static ALWAYS_INLINE uint32_t random_xid(void) | |||
606 | /* Initialize the packet with the proper defaults */ | 606 | /* Initialize the packet with the proper defaults */ |
607 | static void init_packet(struct dhcp_packet *packet, char type) | 607 | static void init_packet(struct dhcp_packet *packet, char type) |
608 | { | 608 | { |
609 | uint16_t secs; | 609 | unsigned secs; |
610 | 610 | ||
611 | /* Fill in: op, htype, hlen, cookie fields; message type option: */ | 611 | /* Fill in: op, htype, hlen, cookie fields; message type option: */ |
612 | udhcp_init_header(packet, type); | 612 | udhcp_init_header(packet, type); |
@@ -617,7 +617,7 @@ static void init_packet(struct dhcp_packet *packet, char type) | |||
617 | if (client_data.first_secs == 0) | 617 | if (client_data.first_secs == 0) |
618 | client_data.first_secs = client_data.last_secs; | 618 | client_data.first_secs = client_data.last_secs; |
619 | secs = client_data.last_secs - client_data.first_secs; | 619 | secs = client_data.last_secs - client_data.first_secs; |
620 | packet->secs = htons(secs); | 620 | packet->secs = (secs < 0xffff) ? htons(secs) : 0xffff; |
621 | 621 | ||
622 | memcpy(packet->chaddr, client_data.client_mac, 6); | 622 | memcpy(packet->chaddr, client_data.client_mac, 6); |
623 | if (client_data.clientid) | 623 | if (client_data.clientid) |