masc2008 commented on code in PR #3451:
URL: https://github.com/apache/nuttx-apps/pull/3451#discussion_r3072164171
##########
netutils/netlib/netlib_obtainipv4addr.c:
##########
@@ -156,6 +214,18 @@ static int dhcp_obtain_statefuladdr(FAR const char *ifname)
if (ret == OK)
{
ret = dhcp_setup_result(ifname, &ds);
+#ifdef CONFIG_NETUTILS_NTPCLIENT
+ if (ret == OK)
+ {
+ ret = dhcp_set_ntp_servers(&ds);
Review Comment:
ntpc_start_with_list() is an explicit runtime override, not a DHCP update
API. Calling it directly from
DHCP would blur source ownership and produce the wrong precedence behavior.
Why:
- ntpc_start_with_list() represents a caller-chosen server list with
highest priority.
- DHCP option 42 is dynamic network-provided configuration, not an
explicit override.
- The design in this patch needs ntpc to remember that the current source
is DHCP, so later DHCP renew/
update/remove events can:
- restart onto a new DHCP list
- fall back to CONFIG_NETUTILS_NTPCLIENT_SERVER when DHCP servers
disappear
- auto-start only from the no-server state
- ntpc_start_with_list() only starts the daemon with a list; it does not
manage DHCP-origin state,
stored DHCP server lists, or DHCP-triggered transitions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]