Add support for setting SNTP servers via DHCPv6#25
Merged
Conversation
This bring parity between DHCPv4 and DHCPv6 allowing DHCPv6 servers to specify an SNTP server to use. Only a single SNTP server slot is allocated to DHCPv6 (the same as v4). Tests: - Start a WeMos D1 on a network which only provides IPv6 addresses via DHCPv6 with 0, 1 or 3 SNTP servers configured - Verify that the SNTP is configured and that time is correct with an updated IPv6.ino sketch that reports SNTP servers and the current time Signed-off-by: David J. Fiddes <D.J@fiddes.net>
d-a-v
approved these changes
Jan 22, 2019
Owner
|
Thanks! Did you propose your path to lwIP ? |
d-a-v
reviewed
Jan 22, 2019
|
|
||
| if (ip_2_ip4(&netif->ip_addr)->addr) | ||
| // If we have a valid address of any type restart SNTP | ||
| if (ip_addr_isany(&netif->ip_addr)) |
Owner
There was a problem hiding this comment.
After re-reading is it not if (!ip_addr_isany(&netif->ip_addr)) instead ?
Contributor
Author
|
Yes. You are correct. This breaks IPv4 SNTP support. I'm trying to figure out why it works. It seems that when a DHCPv6 address is received, netif_sta_status_callback() is called but the netif->ip_addr value is set to all zeros. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This bring parity between DHCPv4 and DHCPv6 allowing DHCPv6
servers to specify an SNTP server to use. Only a single SNTP
server slot is allocated to DHCPv6 (the same as v4).
Tests:
addresses via DHCPv6 with 0, 1 or 3 SNTP servers
configured
correct with an updated IPv6.ino sketch that reports
SNTP servers and the current time
Signed-off-by: David J. Fiddes D.J@fiddes.net