FIX: Servers should drop received DNS response messages, not propagate them for processing. (#381)

This commit is contained in:
Ximon Eighteen
2024-10-03 13:34:55 +02:00
committed by GitHub
parent 1c7be5d8d0
commit 930786ed2e
2 changed files with 22 additions and 1 deletions
+10
View File
@@ -670,6 +670,7 @@ where
match Message::from_octets(buf) {
Err(err) => {
// TO DO: Count this event?
tracing::warn!(
"Failed while parsing request message: {err}"
);
@@ -678,6 +679,15 @@ where
));
}
// https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1
// 4.1.1. Header section format
// "QR A one bit field that specifies whether this
// message is a query (0), or a response (1)."
Ok(msg) if msg.header().qr() => {
// TO DO: Count this event?
trace!("Ignoring received message because it is a reply, not a query.");
}
Ok(msg) => {
let ctx = NonUdpTransportContext::new(Some(
self.config.load().idle_timeout,
+12 -1
View File
@@ -511,7 +511,18 @@ where
tokio::spawn(async move {
match Message::from_octets(buf) {
Err(err) => {
tracing::warn!("Failed while parsing request message: {err}");
// TO DO: Count this event?
warn!("Failed while parsing request message: {err}");
}
// https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1
// 4.1.1. Header section format
// "QR A one bit field that specifies whether
// this message is a query (0), or a
// response (1)."
Ok(msg) if msg.header().qr() => {
// TO DO: Count this event?
trace!("Ignoring received message because it is a reply, not a query.");
}
Ok(msg) => {