Skip to content
Snippets Groups Projects
Commit 24046dda authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Fixed a potential problem with UDP answering.

Some newer versions of libc exported recvmmsg() symbol,
so it was detected even if the kernel couldn't support it.

refs #1995 @1h30m
parent 995502cb
Branches
Tags
No related merge requests found
......@@ -429,7 +429,9 @@ static inline int udp_master_recvmmsg(dthread_t *thread, stat_t *thread_stat)
/* Error and interrupt handling. */
if (unlikely(n <= 0)) {
if (errno != EINTR && errno != 0) {
if (errno != EINTR && errno != 0 && n < 0) {
log_server_error("I/O failure in UDP - errno %d "
"(Linux/recvmmsg)", errno);
dbg_net("udp: recvmmsg() failed: %d\n",
errno);
}
......@@ -489,7 +491,10 @@ void __attribute__ ((constructor)) udp_master_init()
#ifdef MSG_WAITFORONE
/* Check for recvmmsg() support. */
if (dlsym(RTLD_DEFAULT, "recvmmsg") != 0) {
_udp_master = udp_master_recvmmsg;
int r = recvmmsg(-1, NULL, 0, 0, 0);
if (errno != ENOSYS) {
_udp_master = udp_master_recvmmsg;
}
}
/* Check for sendmmsg() support. */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment