Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embedded dnsmasq to v2.88rc4 #1494

Merged
merged 3 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
cmake_minimum_required(VERSION 2.8.12)
project(PIHOLE_FTL C)

set(DNSMASQ_VERSION pi-hole-v2.88rc3)
set(DNSMASQ_VERSION pi-hole-v2.88rc4)

add_subdirectory(src)
2 changes: 1 addition & 1 deletion src/dnsmasq/dnssec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
algo = *p++;
digest = *p++;

if (!ds_digest_name(digest) || !ds_digest_name(digest))
if (!ds_digest_name(digest) || !algo_digest_name(algo))
{
a.log.keytag = keytag;
a.log.algo = algo;
Expand Down
55 changes: 35 additions & 20 deletions src/dnsmasq/domain-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,23 @@ static int order_qsort(const void *a, const void *b)
return rc;
}


/* When loading large numbers of server=.... lines during startup,
there's no possibility that there will be server records that can be reused, but
searching a long list for each server added grows as O(n^2) and slows things down.
This flag is set only if is known there may be free server records that can be reused.
There's a call to mark_servers(0) in read_opts() to reset the flag before
main config read. */

static int maybe_free_servers = 0;

/* Must be called before add_update_server() to set daemon->servers_tail */
void mark_servers(int flag)
{
struct server *serv, **up;

maybe_free_servers = !!flag;

daemon->servers_tail = NULL;

/* mark everything with argument flag */
Expand Down Expand Up @@ -667,27 +679,30 @@ int add_update_server(int flags,
and move to the end of the list, for order. The entry found may already
be at the end. */
struct server **up, *tmp;

for (serv = daemon->servers, up = &daemon->servers; serv; serv = tmp)
{
tmp = serv->next;
if ((serv->flags & SERV_MARK) &&
hostname_isequal(alloc_domain, serv->domain))
{
/* Need to move down? */
if (serv->next)
{
*up = serv->next;
daemon->servers_tail->next = serv;
daemon->servers_tail = serv;
serv->next = NULL;
}
break;
}
else
up = &serv->next;
}

serv = NULL;

if (maybe_free_servers)
for (serv = daemon->servers, up = &daemon->servers; serv; serv = tmp)
{
tmp = serv->next;
if ((serv->flags & SERV_MARK) &&
hostname_isequal(alloc_domain, serv->domain))
{
/* Need to move down? */
if (serv->next)
{
*up = serv->next;
daemon->servers_tail->next = serv;
daemon->servers_tail = serv;
serv->next = NULL;
}
break;
}
else
up = &serv->next;
}

if (serv)
{
free(alloc_domain);
Expand Down
5 changes: 4 additions & 1 deletion src/dnsmasq/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -5763,7 +5763,10 @@ void read_opts(int argc, char **argv, char *compile_opts)
/******** Pi-hole modification ********/
add_txt("version.FTL", (char*)get_FTL_version(), 0 );
/**************************************/


/* See comment above make_servers(). Optimises server-read code. */
mark_servers(0);

while (1)
{
#ifdef HAVE_GETOPT_LONG
Expand Down