From 5acfe55d7139a5294192bddf10fe3a1de3180e8d Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Tue, 14 Jun 2016 11:00:21 +0100 Subject: dnsmasq: dnssec time handling uses ntpd hotplug Change dnsmasq's dnssec time check handling to use time validity indicated by ntpd rather than maintaining a cross boot/upgrade /etc/dnsmasq.time timestamp file. This saves flash device wear. If ntpd client is configured in uci and you're using dnssec, then dnsmasq will not check dnssec timestamp validity until ntpd hotplug indicates sync via a stratum change. The ntpd hotplug leaves a status flag file to indicate to dnsmasq.init that time is valid and that it should now start in 'check dnssec timestamp valid' mode. If ntpd client is not configured and you're using dnssec, then it is presumed you're using an alternate time sync mechanism and that time is correct, thus dnsmasq checks dnssec timestamps are valid from 1st start. Signed-off-by: Kevin Darbyshire-Bryant V2 - stratum & step ntp changes indicate time is valid V3 - on initial flag file step signal dnsmasq with SIGHUP if running V4 - only accept step ntp changes. Accepting both stratum & step could result in unpleasant script race conditions V5 - Actually only accepting stratum is the correct thing to do after further testing V6 - improve handling of non busybox ntpd if sysntpd not executable dnsmasq checks dnssec timestamps else sysntp script disabled - look for timestamp file - allows external mechanism to use hotplug flag file sysntp script enabled & uci ntp enabled - look for timestamp file sysntp script enabled & uci ntp disabled - dnsmasq checks dnssec timestamps fi --- package/network/services/dnsmasq/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'package/network/services/dnsmasq/Makefile') diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index d0eea97a9c..aed40b2972 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.76 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq @@ -142,6 +142,8 @@ define Package/dnsmasq/install $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq $(INSTALL_DIR) $(1)/etc/hotplug.d/iface $(INSTALL_DATA) ./files/dnsmasq.hotplug $(1)/etc/hotplug.d/iface/25-dnsmasq + $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp + $(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec endef Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install) @@ -151,8 +153,6 @@ $(call Package/dnsmasq/install,$(1)) ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec),) $(INSTALL_DIR) $(1)/usr/share/dnsmasq $(INSTALL_DATA) $(PKG_BUILD_DIR)/trust-anchors.conf $(1)/usr/share/dnsmasq - $(INSTALL_DIR) $(1)/lib/upgrade - $(INSTALL_BIN) ./files/dnsmasqsec-add-conffiles.sh $(1)/lib/upgrade endif endef -- cgit v1.2.3