mirror of
https://github.com/smoltcp-rs/smoltcp.git
synced 2025-10-02 07:10:39 +00:00
dns: Failure if no addresses are received
This commit is contained in:
parent
dd18f3c450
commit
5aff1c257a
@ -23,7 +23,7 @@ libc = { version = "0.2.18", optional = true }
|
||||
bitflags = { version = "1.0", default-features = false }
|
||||
defmt = { version = "0.3", optional = true }
|
||||
cfg-if = "1.0.0"
|
||||
heapless = "0.7.7"
|
||||
heapless = "0.7.8"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.9"
|
||||
|
@ -245,6 +245,7 @@ impl<'a> DnsSocket<'a> {
|
||||
net_trace!("question type mismatch");
|
||||
return Err(Error::Malformed);
|
||||
}
|
||||
|
||||
if !eq_names(p.parse_name(question.name), p.parse_name(&pq.name))? {
|
||||
net_trace!("question name mismatch");
|
||||
return Err(Error::Malformed);
|
||||
@ -295,7 +296,10 @@ impl<'a> DnsSocket<'a> {
|
||||
|
||||
if !addresses.is_empty() {
|
||||
q.state = State::Completed(CompletedQuery { addresses })
|
||||
} else {
|
||||
q.state = State::Failure;
|
||||
}
|
||||
|
||||
// If we get here, packet matched the current query, stop processing.
|
||||
return Ok(());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user