Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gdhcp: Use REQUEST_TIMEOUT for renew request
Rearming the timer with start_renew_timeout is basically useless. 1) DHCP is answering the renew request: listener_event will stop the timer and change the state machine either from RENEWING to BOUND or INIT_SELECTING. 2) DHCP is not answering (uplink dead etc): the timer will expire and start_rewew_timeout will just rearm the timer. What happens in 1) is normal operation mode and this patch does not change normal operation. Instead 2) is now handled differently. We will report via 'no lease' event that we were not able to renew the lease. The DHCP client user needs to decide what to do. In the log below you see the DHCP user decided to start IPv4LL when the DHCP server was not reachable. connmand[6580]: DHCP: switch listening mode (0 ==> 1) connmand[6580]: DHCP: sending DHCP discover request connmand[6580]: DHCP: sending DHCP discover request connmand[6580]: DHCP: received DHCP packet xid 0x0000 (current state 0) connmand[6580]: DHCP: start request (retries 0) connmand[6580]: DHCP: sending DHCP select request connmand[6580]: DHCP: received DHCP packet xid 0x0000 (current state 1) connmand[6580]: DHCP: switch listening mode (1 ==> 0) connmand[6580]: src/dhcp.c:lease_available_cb() Lease available connmand[6580]: src/dhcp.c:lease_available_cb() last address 192.168.101.28 connmand[6580]: src/dhcp.c:lease_available_cb() c_address (null) connmand[6580]: Setting domainname to bmw-carit.intra connmand[6580]: DHCP: start bound connmand[6580]: DHCP: processed DHCP packet (new state 2) connmand[6580]: em1 {add} address 192.168.101.28/16 label em1 family 2 connmand[6580]: ntp: time slew -0.000669 s connmand[6580]: em1 {add} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK> connmand[6580]: em1 {add} route 192.168.0.254 gw 0.0.0.0 scope 253 <LINK> connmand[6580]: em1 {add} route 0.0.0.0 gw 192.168.0.254 scope 0 <UNIVERSE> connmand[6580]: em1 {add} route 81.169.141.235 gw 192.168.0.254 scope 0 <UNIVERSE> connmand[6580]: Client-IP: 88.217.137.244 connmand[6580]: Client-Country: DE connmand[6580]: Client-Region: 02 connmand[6580]: Client-Timezone: Europe/Berlin connmand[6580]: em1 {del} route 81.169.141.235 gw 192.168.0.254 scope 0 <UNIVERSE> connmand[6580]: DHCP: start renew timeout connmand[6580]: DHCP: switch listening mode (0 ==> 2) connmand[6580]: DHCP: sending DHCP renew request connmand[6580]: DHCP: renew request timeout connmand[6580]: src/dhcp.c:no_lease_cb() No lease available connmand[6580]: src/dhcp.c:dhcp_invalidate() dhcp 0x7091a0 callback 0 connmand[6580]: src/dhcp.c:dhcp_invalidate() last address 192.168.101.28 connmand[6580]: em1 {del} address 192.168.101.28/16 label em1 connmand[6580]: em1 {del} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK> connmand[6580]: IPV4LL: sending IPV4LL probe request connmand[6580]: IPV4LL: switch listening mode (0 ==> 3) connmand[6580]: IPV4LL: IPV4LL probe timeout (retries 1) connmand[6580]: IPV4LL: sending IPV4LL probe request connmand[6580]: IPV4LL: IPV4LL probe timeout (retries 2) connmand[6580]: IPV4LL: sending IPV4LL probe request connmand[6580]: IPV4LL: IPV4LL probe timeout (retries 3) connmand[6580]: IPV4LL: sending IPV4LL announce request connmand[6580]: IPV4LL: request timeout (retries 1) connmand[6580]: IPV4LL: sending IPV4LL announce request connmand[6580]: IPV4LL: request timeout (retries 2) connmand[6580]: IPV4LL: switching to monitor mode
- Loading branch information