Commit Graph

19 Commits

Author SHA1 Message Date
Michael Tremer
83e5f67256 unbound-dhcp-leases-bridge: Fix exception when running without debug
Fixes: https://bugzilla.ipfire.org/show_bug.cgi?id=12622
Fixes: #12622
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-05-17 15:33:13 +00:00
Michael Tremer
a8b1843bf7 unbound-dhcp-leases-bridge: Fix shebang
Reported-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-05-14 13:22:37 +00:00
Michael Tremer
96c86cf621 unbound-dhcp-leases-bridge: Migrate to Python 3
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-05-14 11:54:21 +00:00
Michael Tremer
7be4822f3d unbound: Make dhcp-leases.conf readable for everyone
unbound runs as nobody and cannot reload its configuration
when this file is only readable for root.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-13 21:43:27 +01:00
Peter Müller
4a46575628 unbound-dhcp-leases-bridge: handle PTR generation parameter
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reported-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-15 12:22:51 +01:00
Michael Tremer
b666975ec2 unbound-dhcp-leases-bridge: Replace leases file atomically
When there is a large number of leases, writing the file may
take a long time. When unbound is re-reading its configuration
in that time, the file might syntactically incorrect.

This change writes the file first and then moves it
to the right place in one transaction.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-28 12:51:06 +00:00
Michael Tremer
8b1eb795ac unbound-dhcp-bridge: Make leases unique by IP address
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-15 22:32:05 +01:00
Michael Tremer
3ec5ba501e unbound-dhcp-bridge: Only update cache when lease was added/removed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-15 19:17:44 +02:00
Michael Tremer
c7b83f9bed unbound-dhcp-bridge: Rewrite update algorithm
Before the bridge tries reading any existing leases from unbound
but this makes it difficult to destinguish between what is a DHCP lease,
static host entry or anything else.

This patch will change the bridge back to just remember what has been
added to the cache already which makes it easier to keep track.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-15 19:08:22 +02:00
Michael Tremer
5d4f3a42ce unbound-dhcp-bridge: Skip processing leases with empty hostname
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-15 19:06:27 +02:00
Michael Tremer
7354d2947a unbound-dhcp-bridge: Reading in static hosts
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-15 19:05:11 +02:00
Michael Tremer
86c9deb2ea unbound: Public static leases in DNS, too
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-11 19:14:33 +02:00
Michael Tremer
998e880b61 unbound: Skip invalid hostnames
If there are any invalid hostnames in the DHCP leases
table, we just skip them and do not create and RRs for
them.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-10 20:11:57 +01:00
Michael Tremer
e22bcd38d6 unbound: Correctly format PTR records
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-10-06 10:42:49 +01:00
Michael Tremer
d20ef9d703 unbound+DHCP: Make sure to only remove old leases and not static hosts
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-09-14 16:35:41 +01:00
Michael Tremer
74a5ab67fe unbound+DHCP: Read correct DHCP domain name for lease
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-09-14 16:29:53 +01:00
Michael Tremer
b8dd42b9a6 unbound+DHCP: Read existing leases from unbound
This allows us to restart unbound and all DHCP leases
will be re-imported even if the unbound-dhcp-leases-bridge is
not restarted.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-09-14 15:54:36 +01:00
Michael Tremer
077ea717e0 unbound+DHCP: Set TTL for local leases to 1m
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-09-12 21:14:44 +01:00
Michael Tremer
0fbd7c3c81 Import Unbound DHCP Lease Bridge
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-08-06 16:48:39 +01:00