aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ntp_server.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ntp_server.c b/src/ntp_server.c
index 3d8298f4a..0705c7fc9 100644
--- a/src/ntp_server.c
+++ b/src/ntp_server.c
@@ -81,8 +81,9 @@ ntp_server_handle(struct ntp_server *ntp)
unsigned char buf[32];
struct sockaddr addr;
int iter;
- unsigned int addr_len = sizeof(addr);
- int num_bytes = recvfrom(ntp->fd, buf, sizeof(buf), 0, &addr, &addr_len);
+ socklen_t addr_len = sizeof(addr);
+ ssize_t num_bytes = recvfrom(ntp->fd, (void *)buf, sizeof(buf), 0,
+ &addr, &addr_len);
if (num_bytes == 0) {
return false;
}
@@ -95,7 +96,8 @@ ntp_server_handle(struct ntp_server *ntp)
}
fill_time_buffer(buf + 24);
- num_bytes = sendto(ntp->fd, buf, num_bytes, 0, &addr, addr_len);
+ num_bytes = sendto(ntp->fd, (void *)buf, num_bytes, 0,
+ &addr, addr_len);
return num_bytes == sizeof(buf);
}