openwrt/package/network
Pierre Gaufillet 5dddea8513 dnsmasq: add ubus lease management methods
Add three ubus methods to dnsmasq's existing ubus interface:
- add_lease: inject a DHCP lease (IPv4/IPv6) via ubus
- delete_lease: remove a lease by IP address
- get_leases: enumerate all active leases as JSON

These methods provide ubus parity with dnsmasq's existing D-Bus
AddDhcpLease/DeleteDhcpLease (since v2.73), with improvements:
script suppression for HA setups, hostname validation, correct
IPv6 domain lookup, and lease enumeration (no D-Bus equivalent).

The patch follows the same patterns as the existing ubus metrics
and set_connmark_allowlist methods. ~400 lines, all behind
#ifdef HAVE_DHCP guards.

Also submitted upstream to dnsmasq-discuss. If accepted upstream,
this carried patch can be dropped.

Tested on: OpenWrt 25.12 (x86_64 + filogic), production.

Signed-off-by: Pierre Gaufillet <pierre.gaufillet@bergamote.eu>
Link: https://github.com/openwrt/openwrt/pull/22904
Signed-off-by: Nick Hainke <nick.hainke@posteo.de>
2026-11-25 22:06:08 +01:00
..
config
…
ipv6
…
services dnsmasq: add ubus lease management methods 2026-11-25 22:06:08 +01:00
utils
…