We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1826978 commit 47018feCopy full SHA for 47018fe
features/net/FEATURE_IPV4/TESTS/mbedmicro-net/nist_internet_time_service/main.cpp
@@ -42,11 +42,12 @@ int main() {
42
int ret_send = sock.sendto(nist, (void*)ntp_send_values, sizeof(ntp_send_values));
43
printf("UDP: Sent %d Bytes to NTP server \n", ret_send);
44
45
- const int n = sock.recvfrom(NULL, (void*)ntp_recv_values, sizeof(ntp_recv_values));
+ SocketAddress source;
46
+ const int n = sock.recvfrom(&source, (void*)ntp_recv_values, sizeof(ntp_recv_values));
47
48
printf("UDP: Recved from NTP server %d Bytes \n", n);
49
- if (n > 0) {
50
+ if (n > 0 && strcmp(source.get_ip_address(), nist.get_ip_address()) == 0) {
51
result = true;
52
53
printf("UDP: Values returned by NTP server: \n");
0 commit comments