Skip to content

netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and rebinding (T2) time from DHCP packet #3152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nuttxs
Copy link
Contributor

@nuttxs nuttxs commented Aug 5, 2025

Summary

  • netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and rebinding (T2) time from DHCP packet
  • According to RFC 2131, T1 and T2 times play a critical role in lease management in DHCP clients.

T1 Time (Renewal Time)
Definition: The time at which the client enters the RENEWING state.
Default Value: 50% of the lease time (0.5 × lease_time).

T2 Time (Rebinding Time)
Definition: The time at which the client enters the REBINDING state.
Default Value: 87.5% of the lease time (0.875 × lease_time).

Impact

New Feature/Change: Correctly receive and store T1 and T2 time provided by the server
User Impact: Provide a foundation for the implementation of intelligent renewal mechanism in the future
Build Impact:No new Kconfig options or build system changes.
Hardware Impact: No
Security: No
Compatibility: Backward-compatible; no breaking changes.

Testing

#Use tcpdump to capture DHCP traffic
#View options 58 and 59 in DHCP ACK packets
#Option 58: T1 Time
#Option 59: T2 Time

图片

rebinding (T2) time from DHCP packet.
According to RFC 2131, T1 and T2 times play a critical role in lease
management in DHCP clients.

Signed-off-by: nuttxs <[email protected]>
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nuttxs :-)

@xiaoxiang781216 xiaoxiang781216 merged commit 8f3c3c5 into apache:master Aug 6, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants