From 4e056dfd7e837853c4209ba7f40592a57b371a5b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Feb 2018 17:06:37 +0100 Subject: [PATCH] Always store client IP in the database (never the host name). We do this for consistency as we will always have IP addresses but not always host names so the current situation can actually be messy in the database. Furthermore, it should be noted that we also only ever store IP addresses (and never host names!) for the forward destinations. Signed-off-by: DL6ER --- database.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/database.c b/database.c index 58f930ec..b6237741 100644 --- a/database.c +++ b/database.c @@ -354,10 +354,7 @@ void save_to_DB(void) sqlite3_bind_text(stmt, 4, domains[queries[i].domainID].domain, -1, SQLITE_TRANSIENT); // CLIENT - if(strlen(clients[queries[i].clientID].name) > 0) - sqlite3_bind_text(stmt, 5, clients[queries[i].clientID].name, -1, SQLITE_TRANSIENT); - else - sqlite3_bind_text(stmt, 5, clients[queries[i].clientID].ip, -1, SQLITE_TRANSIENT); + sqlite3_bind_text(stmt, 5, clients[queries[i].clientID].ip, -1, SQLITE_TRANSIENT); // FORWARD if(queries[i].status == 2 && queries[i].forwardID > -1)