-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
The below is in regards to the built-in tcp/ip stack.
The MG_TCPIP_EV_DHCP_SNTP event won't fire when the DHCP response contains more than one NTP server. The parsing code requires exactly length 4 (a single address), but this can be a list with more than one.
As long as you are OK with only accepting the first address, the fix is pretty simple
- } else if (ifp->enable_req_sntp && p[0] == 42 && p[1] == sizeof(sntp) &&
+ } else if (ifp->enable_req_sntp && p[0] == 42 && p[1] >= sizeof(sntp) &&
It looks like parsing of the DHCP option has the same problem, but my DHCP only hands out a single address there so I haven't run into it. I suggest that both are either fixed (or not) together.
Environment
- mongoose version: HEAD as of 1/9/26
- Compiler/IDE and SDK: Pico SDK 2.2.0
- Target hardware/board: pico2_w
- Connectivity chip/module: pico
- Target RTOS/OS (if applicable): N/A
Metadata
Metadata
Assignees
Labels
No labels