Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:fake dns #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion leaf/src/app/fake_dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ impl FakeDnsImpl {
}

fn allocate_ip(&mut self, domain: &str) -> Ipv4Addr {
let ip = self.get_ip();
if let Some(prev_domain) = self.ip_to_domain.insert(self.cursor, domain.to_owned()) {
// Remove the entry in the reverse map to make sure we won't have
// multiple domains point to a same IP.
self.domain_to_ip.remove(&prev_domain);
}
let ip = self.get_ip();
self.domain_to_ip.insert(domain.to_owned(), self.cursor);
self.cursor += 1;
ip
Expand Down