mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Currently, any failure in the `StubResolver` while processing a query results only in a log but no response. For UDP DNS queries, that isn't too bad because the client will simply retry. With the upcoming support for TCP DNS queries in #6944, we should really always reply with a message. This PR refactors the handling of DNS messages to always generate a reply. In the case of an error, we reply with SERVFAIL. This opens up a few more refactorings where we can now collapse the handling of some branches into the same. As part of that, I noticed the recurring need for "unwrapping" a `Result<(), E>` and logging the error. To make that easier, I introduced an extension trait that does exactly that.