mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Respect settings RESOLVE_IPV4 and RESOLVE_IPv6 also when trying to resolve host names from the database (network table)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -1695,6 +1695,15 @@ char *__attribute__((malloc)) getNameFromIP(const char *ipaddr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Check if we want to resolve host names
|
||||
if(!resolve_this_name(ipaddr))
|
||||
{
|
||||
if(config.debug & DEBUG_DATABASE)
|
||||
logg("getNameFromIP(\"%s\") - configured to not resolve host name", ipaddr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Check for a host name associated with the same IP address
|
||||
sqlite3_stmt *stmt = NULL;
|
||||
const char *querystr = "SELECT name FROM network_addresses WHERE name IS NOT NULL AND ip = ?;";
|
||||
@@ -1858,6 +1867,14 @@ void resolveNetworkTableNames(void)
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we want to resolve host names
|
||||
if(!resolve_names())
|
||||
{
|
||||
if(config.debug & DEBUG_DATABASE)
|
||||
logg("resolveNetworkTableNames() - configured to not resolve host names");
|
||||
return;
|
||||
}
|
||||
|
||||
const char sql[] = "BEGIN TRANSACTION IMMEDIATE";
|
||||
int rc = dbquery(sql);
|
||||
if( rc != SQLITE_OK )
|
||||
|
||||
Reference in New Issue
Block a user