From 59f86aac23aa46c9bc35aae010f4247eab97ee47 Mon Sep 17 00:00:00 2001 From: compile_success <980965867@qq.com> Date: Thu, 21 Jan 2021 16:15:40 +0800 Subject: [PATCH] add backport patches for openeuler --- ...ession-in-s_config_in_context-method.patch | 62 +++++++++++++++++++ dnsmasq.spec | 9 ++- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 backport-fix-regression-in-s_config_in_context-method.patch diff --git a/backport-fix-regression-in-s_config_in_context-method.patch b/backport-fix-regression-in-s_config_in_context-method.patch new file mode 100644 index 0000000..8112509 --- /dev/null +++ b/backport-fix-regression-in-s_config_in_context-method.patch @@ -0,0 +1,62 @@ +From 3d113137fd64cd0723cbecab6a36a75d3ecfb0a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Harald=20Jens=C3=A5s?= +Date: Thu, 7 May 2020 00:33:54 +0200 +Subject: [PATCH 1/1] Fix regression in s_config_in_context() method + +Prior to commit 137286e9baecf6a3ba97722ef1b49c851b531810 +a config would not be considered in context if: +a) it has no address family flags set +b) it has the address family flag of current context set + +Since above commit config is considered in context if the +address family is the opposite of current context. + +The result is that a config with two dhcp-host records, +one for IPv6 and another for IPv4 no longer works, for +example with the below config the config with the IPv6 +address would be considered in context for a DHCP(v4) +request. + dhcp-host=52:54:00:bc:c3:fd,172.20.0.11,host2 + dhcp-host=52:54:00:bc:c3:fd,[fd12:3456:789a:1::aadd],host2 + +This commit restores the previous behavior. + +https://src.fedoraproject.org/rpms/dnsmasq/blob/master/f/dnsmasq-2.81-rh1834454.patch +--- + src/dhcp-common.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/dhcp-common.c b/src/dhcp-common.c +index eae9886..ffc78ca 100644 +--- a/src/dhcp-common.c ++++ b/src/dhcp-common.c +@@ -280,14 +280,18 @@ static int is_config_in_context(struct dhcp_context *context, struct dhcp_config + { + if (!context) /* called via find_config() from lease_update_from_configs() */ + return 1; +- ++ ++ /* No address present in config == in context */ ++ if (!(config->flags & (CONFIG_ADDR | CONFIG_ADDR6))) ++ return 1; ++ + #ifdef HAVE_DHCP6 + if (context->flags & CONTEXT_V6) + { + struct addrlist *addr_list; + + if (!(config->flags & CONFIG_ADDR6)) +- return 1; ++ return 0; + + for (; context; context = context->current) + for (addr_list = config->addr6; addr_list; addr_list = addr_list->next) +@@ -303,7 +307,7 @@ static int is_config_in_context(struct dhcp_context *context, struct dhcp_config + #endif + { + if (!(config->flags & CONFIG_ADDR)) +- return 1; ++ return 0; + + for (; context; context = context->current) + if ((config->flags & CONFIG_ADDR) && is_same_net(config->addr, context->start, context->netmask)) diff --git a/dnsmasq.spec b/dnsmasq.spec index 9607dd3..af4d75a 100644 --- a/dnsmasq.spec +++ b/dnsmasq.spec @@ -1,6 +1,6 @@ Name: dnsmasq Version: 2.82 -Release: 3 +Release: 4 Summary: Dnsmasq provides network infrastructure for small networks License: GPLv2 or GPLv3 URL: http://www.thekelleys.org.uk/dnsmasq/ @@ -18,6 +18,7 @@ Patch7: backport-CVE-2020-25685_1.patch Patch8: backport-CVE-2020-25685_2.patch Patch9: backport-CVE-2020-25686_1.patch Patch10: backport-CVE-2020-25686_2.patch +Patch11: backport-fix-regression-in-s_config_in_context-method.patch BuildRequires: dbus-devel pkgconfig libidn2-devel nettle-devel systemd Requires: nettle >= 3.4 @@ -110,6 +111,12 @@ install -Dpm644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysusersdir}/dnsmasq.conf %{_mandir}/man8/dnsmasq* %changelog +* Thu Jan 21 2021 zhujh - 2.82-4 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:Fix regression in s_config_in_context() method + * Wed Jan 20 2021 liulong - 2.82-3 - Type:CVE - Id:NA -- Gitee