aboutsummaryrefslogtreecommitdiffstats
path: root/main/dnsmasq/0023-Optimize-inserting-records-into-server-list.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/dnsmasq/0023-Optimize-inserting-records-into-server-list.patch')
-rw-r--r--main/dnsmasq/0023-Optimize-inserting-records-into-server-list.patch69
1 files changed, 0 insertions, 69 deletions
diff --git a/main/dnsmasq/0023-Optimize-inserting-records-into-server-list.patch b/main/dnsmasq/0023-Optimize-inserting-records-into-server-list.patch
deleted file mode 100644
index c9b8b2b7c65..00000000000
--- a/main/dnsmasq/0023-Optimize-inserting-records-into-server-list.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Patch-Source: https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commitdiff;h=eb88eed1fc8ed246e9355531c2715fa2f7738afc
-This patch is needed for 0024-Fix-massive-confusion-on-server-reload.patch.
---
-From eb88eed1fc8ed246e9355531c2715fa2f7738afc Mon Sep 17 00:00:00 2001
-From: hev <r@hev.cc>
-Date: Sun, 19 Sep 2021 18:56:08 +0800
-Subject: [PATCH 1/1] Optimize inserting records into server list.
-
-Signed-off-by: hev <r@hev.cc>
----
- src/dnsmasq.h | 2 +-
- src/domain-match.c | 17 ++++++++---------
- 2 files changed, 9 insertions(+), 10 deletions(-)
-
-diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index 327ad65..639c568 100644
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -1105,7 +1105,7 @@ extern struct daemon {
- char *lease_change_command;
- struct iname *if_names, *if_addrs, *if_except, *dhcp_except, *auth_peers, *tftp_interfaces;
- struct bogus_addr *bogus_addr, *ignore_addr;
-- struct server *servers, *local_domains, **serverarray, *no_rebind;
-+ struct server *servers, *servers_tail, *local_domains, **serverarray, *no_rebind;
- int server_has_wildcard;
- int serverarraysz, serverarrayhwm;
- struct ipsets *ipsets;
-diff --git a/src/domain-match.c b/src/domain-match.c
-index 8f29621..3f1cc74 100644
---- a/src/domain-match.c
-+++ b/src/domain-match.c
-@@ -576,7 +576,10 @@ void cleanup_servers(void)
- free(serv);
- }
- else
-- up = &serv->next;
-+ {
-+ up = &serv->next;
-+ daemon->servers_tail = serv;
-+ }
- }
-
- for (serv = daemon->local_domains, up = &daemon->local_domains; serv; serv = tmp)
-@@ -673,18 +676,14 @@ int add_update_server(int flags,
- }
- else
- {
-- struct server *s;
--
- memset(serv, 0, sizeof(struct server));
-
- /* Add to the end of the chain, for order */
-- if (!daemon->servers)
-- daemon->servers = serv;
-+ if (daemon->servers_tail)
-+ daemon->servers_tail->next = serv;
- else
-- {
-- for (s = daemon->servers; s->next; s = s->next);
-- s->next = serv;
-- }
-+ daemon->servers = serv;
-+ daemon->servers_tail = serv;
-
- #ifdef HAVE_LOOP
- serv->uid = rand32();
---
-2.20.1
-