summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Mollier <emollier@debian.org>2023-02-02 22:54:50 +0100
committerÉtienne Mollier <emollier@debian.org>2023-02-02 22:54:50 +0100
commit72d1f7439414744ce20e65a23c7d7ed491ea1221 (patch)
tree7bd6f5d51137a6baa54ea8f962dfe720665f240b
parent58606493b91a3cb2d2c5b4f6208b0e01a840d8df (diff)
parent9301e51cab3a6efdf1da580f5074bafe468d463f (diff)
Update upstream source from tag 'upstream/3.1.0+ds'
Update to upstream version '3.1.0+ds' with Debian dir 478fec58f05f0f46077b5a1c5cf34dc05787c815
-rw-r--r--Changes6
-rw-r--r--META.yml2
-rw-r--r--lib/Zonemaster/LDNS.pm2
-rw-r--r--src/LDNS.xs19
4 files changed, 22 insertions, 7 deletions
diff --git a/Changes b/Changes
index d1579d7..e6e62f0 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,11 @@
Release history for Zonemaster component Zonemaster-LDNS
+3.1.0 2023-01-31 (public fix version)
+ [Feature]
+ - Includes the OPT RDATA from the edns_data function
+ (needed to fix a bug in Zonemaster-Engine) (#166)
+
+
3.0.0 2022-12-19
[Breaking change]
diff --git a/META.yml b/META.yml
index 735eb1a..2f218e3 100644
--- a/META.yml
+++ b/META.yml
@@ -35,4 +35,4 @@ resources:
bugtracker: https://github.com/zonemaster/zonemaster-ldns/issues
license: http://opensource.org/licenses/bsd-license.php
repository: https://github.com/zonemaster/zonemaster-ldns
-version: 3.0.0
+version: 3.1.0
diff --git a/lib/Zonemaster/LDNS.pm b/lib/Zonemaster/LDNS.pm
index a9b88e8..505ec10 100644
--- a/lib/Zonemaster/LDNS.pm
+++ b/lib/Zonemaster/LDNS.pm
@@ -2,7 +2,7 @@ package Zonemaster::LDNS;
use 5.014;
-our $VERSION = '3.0.0';
+our $VERSION = '3.1.0';
use parent 'Exporter';
our @EXPORT_OK = qw[to_idn has_idn ldns_version load_zonefile];
diff --git a/src/LDNS.xs b/src/LDNS.xs
index e4b63a9..0b5dae2 100644
--- a/src/LDNS.xs
+++ b/src/LDNS.xs
@@ -1375,12 +1375,17 @@ packet_edns_version(obj,...)
# -------------------
# Get/set EDNS data
#
-# Beware, this code can only take a unique U32 parameter which means it
-# is not a full implementation of EDNS data but it is enough for our
+# This function acts on the OPT RDATA field of a packet. An OPT RDATA consists of at least one triplet
+# {OPTION-CODE, OPTION-LENGTH, OPTION-DATA}.
+# When given a parameter, this function will set and return the field, although with the limitation described below.
+# Otherwise, it will get and return the field (if any).
+#
+# Beware, when setting OPT RDATA, this code can only take a unique U32 parameter
+# which means it is not a full implementation of EDNS data but it is enough for our
# current purpose. It can only deal with option codes with OPTION-LENGTH=0
# (see 6.1.2 section of RFC 6891) which means OPTION-DATA is always empty.
#
-# returns: a bytes string
+# returns: a bytes string (or undef if no OPT RDATA is found)
#
SV *
packet_edns_data(obj,...)
@@ -1391,7 +1396,7 @@ packet_edns_data(obj,...)
{
SvGETMAGIC(ST(1));
opt = ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, (U32)SvIV(ST(1)));
- if(opt == NULL)
+ if(opt == NULL)
{
croak("Failed to set OPT RDATA");
}
@@ -1399,8 +1404,12 @@ packet_edns_data(obj,...)
}
else {
opt = ldns_pkt_edns_data(obj);
+ if(opt == NULL)
+ {
+ XSRETURN_UNDEF;
+ }
}
- RETVAL = newSVpvn((char*)(opt), 4);
+ RETVAL = newSVpvn((char*)(opt->_data), opt->_size);
OUTPUT:
RETVAL