Subject: | PATCH: UpdateHandler for responding to UPDATE packets |
Attached is a trivial patch (against the current trunk) to add support for handling UPDATE packets. In case copyright is an issue I hereby release it into the Public Domain.
Subject: | net-dns-update-handler-2017-01-03.patch |
diff --git a/lib/Net/DNS/Nameserver.pm b/lib/Net/DNS/Nameserver.pm
index bf5ba26..0639843 100644
--- a/lib/Net/DNS/Nameserver.pm
+++ b/lib/Net/DNS/Nameserver.pm
@@ -233,6 +233,14 @@ sub make_reply {
$rcode = "NOTIMP";
}
+ } elsif ( $opcode eq "UPDATE" ) { #RFC2136
+ if ( ref $self->{UpdateHandler} eq "CODE" ) {
+ ( $rcode, $ans, $auth, $add, $headermask ) =
+ &{$self->{UpdateHandler}}(@arglist);
+ } else {
+ $rcode = "NOTIMP";
+ }
+
} else {
print "ERROR: opcode $opcode unsupported\n" if $self->{Verbose};
$rcode = "FORMERR";
@@ -575,6 +583,9 @@ Attributes are:
NotifyHandler Reference to reply-handling
subroutine for queries with
opcode NOTIFY (RFC1996)
+ UpdateHandler Reference to reply-handling
+ subroutine for queries with
+ opcode UPDATE (RFC2136)
Verbose Print info about received
queries. Defaults to 0 (off).
Truncate Truncates UDP packets that