From 04dd2d70fd1cc779ed0e3a45d273f38d9e90a059 Mon Sep 17 00:00:00 2001 From: songlinzhang Date: Wed, 5 Jan 2022 15:48:32 +0800 Subject: [PATCH] netutils/dhcpc: Fix dhcpc lease bug Signed-off-by: songlinzhang --- netutils/dhcpc/dhcpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c index 2ff771bfd..8df922165 100644 --- a/netutils/dhcpc/dhcpc.c +++ b/netutils/dhcpc/dhcpc.c @@ -468,6 +468,7 @@ static void *dhcpc_run(void *args) else { pdhcpc->callback(NULL); + memset(&result, 0, sizeof(result)); nerr("dhcpc_request error\n"); } @@ -476,6 +477,7 @@ static void *dhcpc_run(void *args) return NULL; } + result.lease_time /= 2; while (result.lease_time) { result.lease_time = sleep(result.lease_time);