Update lease if hostname is assigned to a new lease (#1978718)

This commit is contained in:
Petr Menšík 2021-07-02 10:09:37 +02:00
parent 3ace2e2c82
commit e12e428986
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From bea12dc31409180f6cb3a0578c2340c0116ef003 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Fri, 2 Jul 2021 10:03:47 +0200
Subject: [PATCH] Modify and propagate changed lease
If hostname is reset on existing lease, propagate such change to leases
file and script.
---
src/lease.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/lease.c b/src/lease.c
index b56647d..1a9f1c6 100644
--- a/src/lease.c
+++ b/src/lease.c
@@ -1021,6 +1021,7 @@ void lease_set_hostname(struct dhcp_lease *lease, const char *name, int auth, ch
}
kill_name(lease_tmp);
+ lease_tmp->flags |= LEASE_CHANGED; /* run script on change */
break;
}
}
--
2.31.1

View File

@ -20,7 +20,7 @@
Name: dnsmasq
Version: 2.85
Release: 3%{?extraversion:.%{extraversion}}%{?dist}
Release: 4%{?extraversion:.%{extraversion}}%{?dist}
Summary: A lightweight DHCP/caching DNS server
License: GPLv2 or GPLv3
@ -41,6 +41,8 @@ Patch1: dnsmasq-2.77-underflow.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1852373
Patch2: dnsmasq-2.81-configuration.patch
Patch3: dnsmasq-2.78-fips.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1978718
Patch4: dnsmasq-2.85-lease-hostname.patch
Requires: nettle
@ -182,6 +184,9 @@ install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
%{_mandir}/man1/dhcp_*
%changelog
* Thu Jul 22 2021 Petr Menšík <pemensik@redhat.com> - 2.85-4
- Update lease if hostname is assigned to a new lease (#1978718)
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.85-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild