+* [Bug 2565] Handle EINTR on getifaddrs().
(4.2.7p422) 2014/02/17 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 2536] ntpd sandboxing support (libseccomp2).
(4.2.7p421) 2014/02/10 Released by Harlan Stenn <stenn@ntp.org>
isc_interfaceiter_t *iter;
isc_result_t result;
char strbuf[ISC_STRERRORSIZE];
+ int trys;
REQUIRE(mctx != NULL);
REQUIRE(iterp != NULL);
iter->valid = ISC_R_FAILURE;
#endif
- if (getifaddrs(&iter->ifaddrs) < 0) {
- isc__strerror(errno, strbuf, sizeof(strbuf));
- UNEXPECTED_ERROR(__FILE__, __LINE__,
- isc_msgcat_get(isc_msgcat,
- ISC_MSGSET_IFITERGETIFADDRS,
- ISC_MSG_GETIFADDRS,
- "getting interface "
- "addresses: getifaddrs: %s"),
- strbuf);
- result = ISC_R_UNEXPECTED;
- goto failure;
+ for (trys = 0; trys < 3; trys++) {
+ if (getifaddrs(&iter->ifaddrs) < 0) {
+ if (errno == EINTR)
+ continue;
+
+ isc__strerror(errno, strbuf, sizeof(strbuf));
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
+ isc_msgcat_get(isc_msgcat,
+ ISC_MSGSET_IFITERGETIFADDRS,
+ ISC_MSG_GETIFADDRS,
+ "getting interface "
+ "addresses: getifaddrs: %s"),
+ strbuf);
+ result = ISC_R_UNEXPECTED;
+ goto failure;
+ }
+ break;
}
/*