summaryrefslogtreecommitdiffhomepage
path: root/src/odhcpd.h
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2023-10-21 19:50:25 +0100
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2023-10-23 16:27:10 +0100
commit4bbc6e74248feeb756bd03dc500fb4f446ccfc49 (patch)
tree05ac6873b732d897f760e69f09c30250fce6bd37 /src/odhcpd.h
parentc9e619f015fdcc520c850f8a16e5046fea9660da (diff)
add hostsfile output in addition to statefile
a92c0a7 made the temporary state/leasefile hidden so that an atomic change was made and dnsmasq only saw the new file on rename. A misguided optimisation was made to only rename the temporary file if something had changed. Unfortunately only address and hostnames were considered in the change, lease durations were not. As a result it was possible for LUCI which consumes the state/leasefile to report DHCPv6 leases had expired when they had not. Revert the optimisation so that the file rename occurs irrespective of content change, this keeps LUCI reporting of state/lease expiry correct. This leaves us back with hosts file/dnsmasq update problem. Solve this by writing out a separate hosts file. Update this file using the original IP/Hostname change logic that prompts calling the 'lease' script. odhcpd config now supports a string 'hostsfile' which defines the path and name of the hosts file in an identical manner to 'leasefile'. A state 'leasefile' must be defined IF a 'hostsfile' is also required. eg. leasefile '/tmp/odhcpdstate' hostsfile '/tmp/hosts/odhcpdhosts' Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Diffstat (limited to 'src/odhcpd.h')
-rw-r--r--src/odhcpd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/odhcpd.h b/src/odhcpd.h
index 08b4920..02b6ac0 100644
--- a/src/odhcpd.h
+++ b/src/odhcpd.h
@@ -165,6 +165,7 @@ struct config {
bool main_dhcpv4;
char *dhcp_cb;
char *dhcp_statefile;
+ char *dhcp_hostsfile;
int log_level;
};