/* block until we have at least one message ready, but return
as many as possible to save the syscall costs */
- msgsGot = recvmmsg(clientState->udpFD, msgVec.data(), vectSize, MSG_WAITFORONE | MSG_TRUNC, nullptr);
+ msgsGot = recvmmsg(clientState->udpFD, msgVec.data(), vectSize, MSG_WAITFORONE, nullptr);
if (msgsGot <= 0) {
int savederrno = errno;
VERBOSESLOG(infolog("Getting UDP messages via recvmmsg() failed with: %s", stringerror(savederrno)),
continue;
}
+ if ((msgh->msg_flags & MSG_TRUNC) != 0) {
+ /* message was too large for our buffer */
+ ++clientState->nonCompliantQueries;
+ ++dnsdist::metrics::g_stats.nonCompliantQueries;
+ continue;
+ }
+
auto& data = recvData[msgIdx];
data.packet.resize(got);
dnsdist::configuration::refreshLocalRuntimeConfiguration();