summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bsd/freebsd/contrib/ntp/ntpq/ntpq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bsd/freebsd/contrib/ntp/ntpq/ntpq.c b/bsd/freebsd/contrib/ntp/ntpq/ntpq.c
index 1cea922..0ea6c08 100644
--- a/bsd/freebsd/contrib/ntp/ntpq/ntpq.c
+++ b/bsd/freebsd/contrib/ntp/ntpq/ntpq.c
@@ -828,6 +828,14 @@ openhost(
#ifdef SYS_VXWORKS
(connect(sockfd, (struct sockaddr *)&hostaddr,
sizeof(hostaddr)) == -1)
+#elif defined(__rtems__)
+ /*
+ * lwIP's ai_addrlen covers the entire struct which includes
+ * padding for extra data and is not accurate for calls which
+ * validate the size of the address structure. Use sa_len instead
+ */
+ (connect(sockfd, (struct sockaddr *)ai->ai_addr,
+ ai->ai_addr->sa_len) == -1)
#else
(connect(sockfd, (struct sockaddr *)ai->ai_addr,
ai->ai_addrlen) == -1)