public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. e22bcd38d6857cd1ee7292cbf634db80d0dd813c
Date: Thu, 06 Oct 2016 11:43:50 +0100	[thread overview]
Message-ID: <20161006104351.70EEE1078E81@git01.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3337 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  e22bcd38d6857cd1ee7292cbf634db80d0dd813c (commit)
       via  71cf56fe53a1f561a8d11f2f354a0cc91bfe37ba (commit)
      from  eef9b2529c3cab522dac4f4bcfa1a0075376514e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e22bcd38d6857cd1ee7292cbf634db80d0dd813c
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Thu Oct 6 10:42:49 2016 +0100

    unbound: Correctly format PTR records
    
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

commit 71cf56fe53a1f561a8d11f2f354a0cc91bfe37ba
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Thu Oct 6 10:41:54 2016 +0100

    core106: Restart DHCP server to import leases into DNS
    
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 config/rootfiles/core/106/update.sh       |  3 +++
 config/unbound/unbound-dhcp-leases-bridge | 19 +++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

Difference in files:
diff --git a/config/rootfiles/core/106/update.sh b/config/rootfiles/core/106/update.sh
index e025cfd..09d183e 100644
--- a/config/rootfiles/core/106/update.sh
+++ b/config/rootfiles/core/106/update.sh
@@ -81,6 +81,9 @@ if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then
 	/etc/init.d/ipsec start
 fi
 
+# Restart DHCP server to import leases into unbound
+/etc/init.d/dhcp restart
+
 # This update need a reboot...
 touch /var/run/need_reboot
 
diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge
index 0ef14e1..c62d233 100644
--- a/config/unbound/unbound-dhcp-leases-bridge
+++ b/config/unbound/unbound-dhcp-leases-bridge
@@ -49,6 +49,20 @@ def setup_logging(loglevel=logging.INFO):
 
 log = logging.getLogger("dhcp")
 
+def ip_address_to_reverse_pointer(address):
+	parts = address.split(".")
+	parts.reverse()
+
+	return "%s.in-addr.arpa" % ".".join(parts)
+
+def reverse_pointer_to_ip_address(rr):
+	parts = rr.split(".")
+
+	# Only take IP address part
+	parts = reversed(parts[0:4])
+
+	return ".".join(parts)
+
 class UnboundDHCPLeasesBridge(object):
 	def __init__(self, dhcp_leases_file, unbound_leases_file):
 		self.leases_file = dhcp_leases_file
@@ -301,7 +315,8 @@ class Lease(object):
 			(self.fqdn, "%s" % LOCAL_TTL, "IN A", self.ipaddr),
 
 			# Reverse record
-			(self.ipaddr, "%s" % LOCAL_TTL, "IN PTR", self.fqdn),
+			(ip_address_to_reverse_pointer(self.ipaddr), "%s" % LOCAL_TTL,
+				"IN PTR", self.fqdn),
 		]
 
 
@@ -333,7 +348,7 @@ class UnboundConfigWriter(object):
 			if record_type == "A":
 				ret[hostname] = content
 			elif record_type == "PTR":
-				ret[content] = hostname
+				ret[content] = reverse_pointer_to_ip_address(hostname)
 
 		return ret
 


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2016-10-06 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161006104351.70EEE1078E81@git01.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox