Correct multiple entries with the same mac address (#1834454)
Make sure IPv4 requests search only in IPv4 contexts and vice versa. Do not accept IPv4 record for IPv6 requests, as it would lead to defined assignment.
This commit is contained in:
parent
e8e451a80c
commit
a6995451dc
62
dnsmasq-2.81-rh1834454.patch
Normal file
62
dnsmasq-2.81-rh1834454.patch
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
From 3d113137fd64cd0723cbecab6a36a75d3ecfb0a6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Harald=20Jens=C3=A5s?= <hjensas@redhat.com>
|
||||||
|
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.
|
||||||
|
---
|
||||||
|
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))
|
||||||
|
--
|
||||||
|
2.25.4
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
Name: dnsmasq
|
Name: dnsmasq
|
||||||
Version: 2.81
|
Version: 2.81
|
||||||
Release: 2%{?extraversion:.%{extraversion}}%{?dist}
|
Release: 3%{?extraversion:.%{extraversion}}%{?dist}
|
||||||
Summary: A lightweight DHCP/caching DNS server
|
Summary: A lightweight DHCP/caching DNS server
|
||||||
|
|
||||||
License: GPLv2 or GPLv3
|
License: GPLv2 or GPLv3
|
||||||
@ -35,6 +35,8 @@ Patch3: dnsmasq-2.78-fips.patch
|
|||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1728701
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1728701
|
||||||
Patch7: dnsmasq-2.80-rh1728701.patch
|
Patch7: dnsmasq-2.80-rh1728701.patch
|
||||||
Patch9: dnsmasq-2.80-SIOCGSTAMP.patch
|
Patch9: dnsmasq-2.80-SIOCGSTAMP.patch
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1834454
|
||||||
|
Patch17: dnsmasq-2.81-rh1834454.patch
|
||||||
|
|
||||||
# This is workaround to nettle bug #1549190
|
# This is workaround to nettle bug #1549190
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1549190
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1549190
|
||||||
@ -171,6 +173,9 @@ install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
|
|||||||
%{_mandir}/man1/dhcp_*
|
%{_mandir}/man1/dhcp_*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 11 2020 Petr Menšík <pemensik@redhat.com> - 2.81-3
|
||||||
|
- Correct multiple entries with the same mac address (#1834454)
|
||||||
|
|
||||||
* Thu Apr 16 2020 Petr Menšík <pemensik@redhat.com> - 2.81-2
|
* Thu Apr 16 2020 Petr Menšík <pemensik@redhat.com> - 2.81-2
|
||||||
- Update to 2.81 (#1823139)
|
- Update to 2.81 (#1823139)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user