Skip to content

Commit c44c201

Browse files
vasildjonatack
authored andcommitted
p2p, refactor: drop unused DNSLookupFn param in LookupSubnet()
1 parent f0c9e68 commit c44c201

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: src/netbase.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ bool ConnectThroughProxy(const proxyType& proxy, const std::string& strDest, uin
676676
return true;
677677
}
678678

679-
bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out, DNSLookupFn dns_lookup_function)
679+
bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out)
680680
{
681681
if (!ValidAsCString(subnet_str)) {
682682
return false;
@@ -686,7 +686,7 @@ bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out, DNSLookupF
686686
const std::string str_addr{subnet_str.substr(0, slash_pos)};
687687
CNetAddr addr;
688688

689-
if (LookupHost(str_addr, addr, /*fAllowLookup=*/false, dns_lookup_function)) {
689+
if (LookupHost(str_addr, addr, /*fAllowLookup=*/false)) {
690690
if (slash_pos != subnet_str.npos) {
691691
const std::string netmask_str{subnet_str.substr(slash_pos + 1)};
692692
uint8_t netmask;
@@ -697,7 +697,7 @@ bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out, DNSLookupF
697697
} else {
698698
// Invalid number; try full netmask syntax. Never allow lookup for netmask.
699699
CNetAddr full_netmask;
700-
if (LookupHost(netmask_str, full_netmask, /*fAllowLookup=*/false, dns_lookup_function)) {
700+
if (LookupHost(netmask_str, full_netmask, /*fAllowLookup=*/false)) {
701701
subnet_out = CSubNet{addr, full_netmask};
702702
return subnet_out.IsValid();
703703
}

Diff for: src/netbase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ CService LookupNumeric(const std::string& name, uint16_t portDefault = 0, DNSLoo
176176
* from `subnet_str`.
177177
* @returns whether the operation succeeded or not.
178178
*/
179-
bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out, DNSLookupFn dns_lookup_function = g_dns_lookup);
179+
bool LookupSubNet(const std::string& subnet_str, CSubNet& subnet_out);
180180

181181
/**
182182
* Create a TCP socket in the given address family.

Diff for: src/test/fuzz/netbase_dns_lookup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ FUZZ_TARGET(netbase_dns_lookup)
6464
}
6565
{
6666
CSubNet resolved_subnet;
67-
if (LookupSubNet(name, resolved_subnet, fuzzed_dns_lookup_function)) {
67+
if (LookupSubNet(name, resolved_subnet)) {
6868
assert(resolved_subnet.IsValid());
6969
}
7070
}

0 commit comments

Comments
 (0)