Skip to content

Commit

Permalink
CMake: print comment when appending sha256sum to pihole-FTL
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Oct 13, 2024
1 parent 8f4d862 commit 60f9a0b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE:pihole-FTL> | cut -d ' ' -f 1
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pihole-FTL> $<TARGET_FILE_DIR:pihole-FTL>/pihole-FTL.tmp
COMMAND sha256sum $<TARGET_FILE:pihole-FTL>.tmp | cut -d ' ' -f 1 | xxd -r -p >> $<TARGET_FILE:pihole-FTL>.tmp
Expand Down
4 changes: 1 addition & 3 deletions src/database/network-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/lookup-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
#endif //LOOKUP_TABLE_H

0 comments on commit 60f9a0b

Please sign in to comment.