Skip to content

Commit 4c8abe6

Browse files
authored
Merge pull request #1439 from pi-hole/development
FTL v5.18.1
2 parents f95464d + 1ae0ddc commit 4c8abe6

File tree

4 files changed

+37
-10
lines changed

4 files changed

+37
-10
lines changed

.github/dependabot.yml

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ updates:
1010
target-branch: development
1111
reviewers:
1212
- "pi-hole/ftl-maintainers"
13+
pull-request-branch-name:
14+
# Separate sections of the branch name with a hyphen
15+
separator: "-"

.github/workflows/build.yml

-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ on:
44
push:
55
branches:
66
- '**'
7-
- '!dependabot/**'
87
pull_request:
9-
branches-ignore:
10-
- 'dependabot/**'
118
release:
129
types: [published]
1310

src/dnsmasq_interface.c

+20-1
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,29 @@ void FTL_hook(unsigned int flags, const char *name, union all_addr *addr, char *
134134
// derive the real query type from the arg string
135135
unsigned short qtype = type;
136136
if(strcmp(arg, "dnssec-query[DNSKEY]") == 0)
137+
{
137138
qtype = T_DNSKEY;
139+
arg = (char*)"dnssec-query";
140+
}
138141
else if(strcmp(arg, "dnssec-query[DS]") == 0)
142+
{
139143
qtype = T_DS;
140-
arg = (char*)"dnssec-query";
144+
arg = (char*)"dnssec-query";
145+
}
146+
else if(strcmp(arg, "dnssec-retry[DNSKEY]") == 0)
147+
{
148+
qtype = T_DNSKEY;
149+
arg = (char*)"dnssec-retry";
150+
}
151+
else if(strcmp(arg, "dnssec-retry[DS]") == 0)
152+
{
153+
qtype = T_DS;
154+
arg = (char*)"dnssec-retry";
155+
}
156+
else
157+
{
158+
arg = (char*)"dnssec-unknown";
159+
}
141160

142161
_FTL_new_query(flags, name, NULL, arg, qtype, id, &edns, INTERNAL, file, line);
143162
// forwarded upstream (type is used to store the upstream port)

src/gc.c

+14-6
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,21 @@ time_t get_rate_limit_turnaround(const unsigned int rate_limit_count)
7575
return (time_t)config.rate_limit.interval*how_often - (time(NULL) - lastRateLimitCleaner);
7676
}
7777

78-
static void check_space(const char *file)
78+
static int check_space(const char *file, int LastUsage)
7979
{
8080
if(config.check.disk == 0)
81-
return;
81+
return 0;
8282

8383
int perc = 0;
8484
char buffer[64] = { 0 };
8585
// Warn if space usage at the device holding the corresponding file
86-
// exceeds the configured threshold
87-
if((perc = get_filepath_usage(file, buffer)) > config.check.disk)
86+
// exceeds the configured threshold and current usage is higher than
87+
// usage in the last run (to prevent log spam)
88+
perc = get_filepath_usage(file, buffer);
89+
if(perc > config.check.disk && perc > LastUsage )
8890
log_resource_shortage(-1.0, 0, -1, perc, file, buffer);
91+
92+
return perc;
8993
}
9094

9195
static void check_load(void)
@@ -118,6 +122,10 @@ void *GC_thread(void *val)
118122
lastRateLimitCleaner = time(NULL);
119123
time_t lastResourceCheck = 0;
120124

125+
// Remember disk usage
126+
int LastLogStorageUsage = 0;
127+
int LastDBStorageUsage = 0;
128+
121129
// Run as long as this thread is not canceled
122130
while(!killed)
123131
{
@@ -138,8 +146,8 @@ void *GC_thread(void *val)
138146
if(now - lastResourceCheck >= RCinterval)
139147
{
140148
check_load();
141-
check_space(FTLfiles.FTL_db);
142-
check_space(FTLfiles.log);
149+
LastDBStorageUsage = check_space(FTLfiles.FTL_db, LastDBStorageUsage);
150+
LastLogStorageUsage = check_space(FTLfiles.log, LastLogStorageUsage);
143151
lastResourceCheck = now;
144152
}
145153

0 commit comments

Comments
 (0)