aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index ab3e5a463..4b23e4d39 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -850,7 +850,9 @@ static NOINLINE int send_decline(/*uint32_t xid,*/ uint32_t server, uint32_t req
850#endif 850#endif
851 851
852/* Unicast a DHCP release message */ 852/* Unicast a DHCP release message */
853static int send_release(uint32_t server, uint32_t ciaddr) 853static
854ALWAYS_INLINE /* one caller, help compiler to use this fact */
855int send_release(uint32_t server, uint32_t ciaddr)
854{ 856{
855 struct dhcp_packet packet; 857 struct dhcp_packet packet;
856 858
@@ -1725,8 +1727,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1725 move_from_unaligned32(lease_seconds, temp); 1727 move_from_unaligned32(lease_seconds, temp);
1726 lease_seconds = ntohl(lease_seconds); 1728 lease_seconds = ntohl(lease_seconds);
1727 /* paranoia: must not be too small and not prone to overflows */ 1729 /* paranoia: must not be too small and not prone to overflows */
1728 if (lease_seconds < 0x10) 1730 /* timeout > 60 - ensures at least one unicast renew attempt */
1729 lease_seconds = 0x10; 1731 if (lease_seconds < 2 * 61)
1732 lease_seconds = 2 * 61;
1730 //if (lease_seconds > 0x7fffffff) 1733 //if (lease_seconds > 0x7fffffff)
1731 // lease_seconds = 0x7fffffff; 1734 // lease_seconds = 0x7fffffff;
1732 //^^^not necessary since "timeout = lease_seconds / 2" 1735 //^^^not necessary since "timeout = lease_seconds / 2"