mirror of
https://github.com/NLnetLabs/domain.git
synced 2026-09-26 11:44:54 +02:00
FIX: Servers should drop received DNS response messages, not propagate them for processing. (#381)
This commit is contained in:
@@ -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
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user