Bug 12646

Summary: dhcpc.c not using discover_retries in REQUESTING state
Product: Busybox Reporter: john.lange2
Component: NetworkingAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.31.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description john.lange2 2020-03-16 11:54:09 UTC
dhcpc.c is not using discover_retries while in REQUESTING state. The code assumes a value of 3. Instead, it should use the -t parameter provided on command line. The following diff could address this issue:
1505c1505
<                               if (packet_num < 3) {
---
>                               if (!discover_retries || packet_num <= discover_retries) {

Note "<=" is used so that discover_retries value of 1 will work, since packet_num is also incremented within state INIT_SELECTING.