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 dnsmasq to 2.91rc3 #2182

Merged
merged 3 commits into from
Feb 8, 2025
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 @@ -16,6 +16,6 @@ set(CMAKE_C_STANDARD 17)

project(PIHOLE_FTL C)

set(DNSMASQ_VERSION pi-hole-v2.91rc2)
set(DNSMASQ_VERSION pi-hole-v2.91rc3)

add_subdirectory(src)
2 changes: 1 addition & 1 deletion src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ void parse_args(int argc, char *argv[])
printf("Version: %s%s%s%s\n",
green, bold, get_FTL_version(), normal);
printf("Branch: %s\n", git_branch());
printf("Commit: %s (%s)",git_hash(), git_date());
printf("Commit: %s (%s)\n",git_hash(), git_date());
printf("Architecture: %s\n", ftl_arch());
printf("Compiler: %s\n", ftl_cc());
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
Expand Down
22 changes: 16 additions & 6 deletions src/dnsmasq/forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ static void forward_query(int udpfd, union mysockaddr *udpaddr,
FREC_HAS_PHEADER | FREC_DNSKEY_QUERY | FREC_DS_QUERY | FREC_NO_CACHE)))
{
struct frec_src *src;
struct dns_header *saved_header;
unsigned int casediff = 0;
unsigned int *bitvector = NULL;
unsigned short id;

for (src = &forward->frec_src; src; src = src->next)
if (src->orig_id == ntohs(header->id) &&
Expand Down Expand Up @@ -250,7 +250,7 @@ static void forward_query(int udpfd, union mysockaddr *udpaddr,
goto reply;
}

/* Find a bitmap of case differences between the query send upstream and this one,
/* Find a bitmap of case differences between the query sent upstream and this one,
so we can reply to each query with the correct case pattern.
Since we need this to get back the exact case pattern of each query when doing
query combining, we have to handle the (rare) case that there are case differences
Expand All @@ -261,9 +261,19 @@ static void forward_query(int udpfd, union mysockaddr *udpaddr,
we only scramble the first 32 letters for security reasons.

Note the two names are guaranteed to be the same length and differ only in the case
of letters. */
if ((saved_header = blockdata_retrieve(forward->stash, forward->stash_len, NULL)) &&
extract_request(saved_header, forward->stash_len, daemon->workspacename, NULL))
of letters at this point.

Get the original query into the packet buffer and extract the query name it contains
to calculate the difference in case scrambling. This is important because we
may fall through below and forward the query in the packet buffer again and we
want to use the same case scrambling as the first time.

Retrieve the id from the new query before we overwrite it. */

id = ntohs(header->id);

if (blockdata_retrieve(forward->stash, forward->stash_len, (void *)header) &&
extract_request(header, forward->stash_len, daemon->workspacename, NULL))
{
unsigned int i, gobig = 0;
char *s1, *s2;
Expand Down Expand Up @@ -302,7 +312,7 @@ static void forward_query(int udpfd, union mysockaddr *udpaddr,
daemon->free_frec_src = src->next;
src->next = forward->frec_src.next;
forward->frec_src.next = src;
src->orig_id = ntohs(header->id);
src->orig_id = id;
src->source = *udpaddr;
src->dest = *dst_addr;
src->log_id = daemon->log_id;
Expand Down
Loading