Skip to content

Commit

Permalink
Fixed selector logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Jul 15, 2024
1 parent 63ab021 commit e22ffc6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mirrord/layer/src/socket/dns_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use mirrord_config::feature::network::{
dns::{DnsConfig, DnsFilterConfig},
filter::AddressFilter,
};
use tracing::Level;

use crate::detour::{Bypass, Detour};

Expand All @@ -19,6 +20,7 @@ pub struct DnsSelector {

impl DnsSelector {
/// Bypasses queries that should be done locally.
#[tracing::instrument(level = Level::DEBUG, ret)]
pub fn check_query(&self, node: &str, port: u16) -> Detour<()> {
let matched = self
.filters
Expand Down Expand Up @@ -61,7 +63,7 @@ impl From<&DnsConfig> for DnsSelector {
let (filters, filter_is_local) = match &value.filter {
Some(DnsFilterConfig::Local(filters)) => (Some(filters.deref()), true),
Some(DnsFilterConfig::Remote(filters)) => (Some(filters.deref()), false),
None => (None, false),
None => (None, true),
};

let filters = filters
Expand Down

0 comments on commit e22ffc6

Please sign in to comment.