Skip to content

Commit f3bd785

Browse files
theuniFuzzbawls
authored andcommitted
net: require lookup functions to specify all arguments
To make it clear where DNS resolves are happening
1 parent dc530c0 commit f3bd785

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ void ThreadDNSAddressSeed()
12831283
} else {
12841284
std::vector<CNetAddr> vIPs;
12851285
std::vector<CAddress> vAdd;
1286-
if (LookupHost(seed.host.c_str(), vIPs)) {
1286+
if (LookupHost(seed.host.c_str(), vIPs, 0, true)) {
12871287
for (CNetAddr& ip : vIPs) {
12881288
int nOneDay = 24 * 3600;
12891289
CAddress addr = CAddress(CService(ip, Params().GetDefaultPort()));
@@ -1687,7 +1687,7 @@ void static Discover(boost::thread_group& threadGroup)
16871687
char pszHostName[256] = "";
16881688
if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) {
16891689
std::vector<CNetAddr> vaddr;
1690-
if (LookupHost(pszHostName, vaddr)) {
1690+
if (LookupHost(pszHostName, vaddr, 0, true)) {
16911691
for (const CNetAddr& addr : vaddr) {
16921692
if (AddLocal(addr, LOCAL_IF))
16931693
LogPrintf("%s: %s - %s\n", __func__, pszHostName, addr.ToString());

src/netbase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ bool GetProxy(enum Network net, proxyType& proxyInfoOut);
207207
bool IsProxy(const CNetAddr& addr);
208208
bool SetNameProxy(const proxyType &addrProxy);
209209
bool HaveNameProxy();
210-
bool LookupHost(const char* pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true);
211-
bool Lookup(const char* pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true);
212-
bool Lookup(const char* pszName, std::vector<CService>& vAddr, int portDefault = 0, bool fAllowLookup = true, unsigned int nMaxSolutions = 0);
210+
bool LookupHost(const char* pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup);
211+
bool Lookup(const char* pszName, CService& addr, int portDefault, bool fAllowLookup);
212+
bool Lookup(const char* pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions);
213213
bool LookupNumeric(const char* pszName, CService& addr, int portDefault = 0);
214214
bool ConnectSocket(const CService& addr, SOCKET& hSocketRet, int nTimeout, bool* outProxyConnectionFailed = 0);
215215
bool ConnectSocketByName(CService& addr, SOCKET& hSocketRet, const char* pszDest, int portDefault, int nTimeout, bool* outProxyConnectionFailed = 0);

0 commit comments

Comments
 (0)