diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1a97d6ca89..4efb54d4a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -375,7 +375,7 @@ endif() # After finishing building the FTL binary, we append the sha256sum of the binary # in raw form to itself and print the checksum to the console -add_custom_command(TARGET pihole-FTL POST_BUILD +add_custom_command(TARGET pihole-FTL POST_BUILD COMMENT "Appending sha256sum to pihole-FTL" COMMAND echo -n "SHA256 checksum of pihole-FTL: " && sha256sum $ | cut -d ' ' -f 1 COMMAND ${CMAKE_COMMAND} -E copy $ $/pihole-FTL.tmp COMMAND sha256sum $.tmp | cut -d ' ' -f 1 | xxd -r -p >> $.tmp diff --git a/src/database/network-table.c b/src/database/network-table.c index 3d1d570286..1000e8fc79 100644 --- a/src/database/network-table.c +++ b/src/database/network-table.c @@ -1348,7 +1348,7 @@ void parse_neighbor_cache(sqlite3* db) unlock_shm(); // Device not in database, add new entry - if(dbID == DB_NODATA) + if(clientID >= 0 && dbID == DB_NODATA) { // Try to obtain vendor from MAC database char *macVendor = getMACVendor(hwaddr); @@ -1379,8 +1379,6 @@ void parse_neighbor_cache(sqlite3* db) clientsData *client = getClient(clientID, true); if(client != NULL) { - // Reacquire client pointer (if may have changed when unlocking above) - client = getClient(clientID, true); // Reset client ARP counter (we stored the entry in the database) client->numQueriesARP = 0; } diff --git a/src/gc.c b/src/gc.c index 58a621600f..8fe9186368 100644 --- a/src/gc.c +++ b/src/gc.c @@ -317,7 +317,7 @@ void runGC(const time_t now, time_t *lastGCrun, const bool flush) // Process all queries unsigned int removed = 0; - for(long int i = 0; i < counters->queries; i++) + for(unsigned int i = 0; i < counters->queries; i++) { queriesData *query = getQuery(i, true); if(query == NULL) diff --git a/src/lookup-table.h b/src/lookup-table.h index fe2cc05402..a4ba0c9606 100644 --- a/src/lookup-table.h +++ b/src/lookup-table.h @@ -51,4 +51,4 @@ bool lookup_find_id(const enum memory_type type, const uint32_t hash, const stru bool (*cmp_func)(const struct lookup_table *entry, const struct lookup_data *lookup_data)); void print_lookup_table(const enum memory_type type); -#endif //LOOKUP_TABLE_H \ No newline at end of file +#endif //LOOKUP_TABLE_H