mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2529 from geky/fix-nsapi-nist-test
Fix recvfrom address in ipv4 nist testspull/2544/head
commit
f3d652bbe0
|
@ -42,11 +42,12 @@ int main() {
|
||||||
int ret_send = sock.sendto(nist, (void*)ntp_send_values, sizeof(ntp_send_values));
|
int ret_send = sock.sendto(nist, (void*)ntp_send_values, sizeof(ntp_send_values));
|
||||||
printf("UDP: Sent %d Bytes to NTP server \n", ret_send);
|
printf("UDP: Sent %d Bytes to NTP server \n", ret_send);
|
||||||
|
|
||||||
const int n = sock.recvfrom(&nist, (void*)ntp_recv_values, sizeof(ntp_recv_values));
|
SocketAddress source;
|
||||||
|
const int n = sock.recvfrom(&source, (void*)ntp_recv_values, sizeof(ntp_recv_values));
|
||||||
|
|
||||||
printf("UDP: Recved from NTP server %d Bytes \n", n);
|
printf("UDP: Recved from NTP server %d Bytes \n", n);
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0 && strcmp(source.get_ip_address(), nist.get_ip_address()) == 0) {
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
printf("UDP: Values returned by NTP server: \n");
|
printf("UDP: Values returned by NTP server: \n");
|
||||||
|
|
Loading…
Reference in New Issue