diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index da2f758b4..826c64c99 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -14,6 +14,14 @@

Changes between 3.15.3 and 3.15.4

+

RTEMS NTP Support Issue

+ +

On RTEMS the NTP Time Provider could in some circumstances get out of sync +with the server because the osdNTPGet() code wasn't clearing its input socket +before sending out a new request. This +(Launchpad bug 1549908) +has now been fixed.

+

CA server configuration changes

RSRV now honors EPICS_CAS_INTF_ADDR_LIST and binds only to the provided list @@ -49,7 +57,11 @@ back-porting some earlier changes from the 3.15 branch, and fixes Launchpad bug #1514520.

+<<<<<<< TREE

Fix ipAddrToAsciiAsync(): don't try to join the daemon thread

+======= +

ipAddrToAsciiAsync.: Don't try to join the daemon thread

+>>>>>>> MERGE-SOURCE

On process exit, don't try to stop the worker thread that makes DNS lookups asynchronous. Previously this would wait for any lookups still in progress, diff --git a/src/libCom/osi/os/RTEMS/osdTime.cpp b/src/libCom/osi/os/RTEMS/osdTime.cpp index acefa1b09..e71c64a88 100644 --- a/src/libCom/osi/os/RTEMS/osdTime.cpp +++ b/src/libCom/osi/os/RTEMS/osdTime.cpp @@ -10,6 +10,9 @@ * * Author: W. Eric Norum */ +#define __BSD_VISIBLE 1 +#include +#include #include #include @@ -40,8 +43,37 @@ void osdTimeRegister(void) int osdNTPGet(struct timespec *ts) { + static unsigned bequiet; + ssize_t ret; + if (ntpSocket < 0) return -1; + + /* rtems_bsdnet_get_ntp() will send an NTP request, then + * call recvfrom() exactly once to process the expected reply. + * Any leftovers in the socket buffer (ie. duplicates of + * previous replies) will cause problems. + * So flush out the socket buffer first. + */ + do { + char junk[16]; + + ret = recvfrom(ntpSocket, junk, sizeof(junk), MSG_DONTWAIT, NULL, NULL); + if (ret == -1 && errno == EAGAIN) { + break; + } + else if (ret == -1) { + if (!bequiet) { + printf("osdNTPGet cleaner error: %s\n", strerror(errno)); + bequiet = 1; + } + break; + } + else { + bequiet = 0; + } + } while (ret > 0); + return rtems_bsdnet_get_ntp(ntpSocket, NULL, ts); }