diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:19:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:19:40 +0000 |
commit | 0a0abc373c07a7744adac48891a393e0882fdb6f (patch) | |
tree | 725955c83a4b5835007e94d0f85bb908d42ca897 /src/resolve/resolved-dns-rr.c | |
parent | Releasing progress-linux version 252.23-1~deb12u1progress7u1. (diff) | |
download | systemd-0a0abc373c07a7744adac48891a393e0882fdb6f.tar.xz systemd-0a0abc373c07a7744adac48891a393e0882fdb6f.zip |
Merging upstream version 252.25.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index a4379c1..c449efa 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -181,6 +181,23 @@ bool dns_resource_key_is_dnssd_ptr(const DnsResourceKey *key) { dns_name_endswith(dns_resource_key_name(key), "_udp.local"); } +bool dns_resource_key_is_dnssd_two_label_ptr(const DnsResourceKey *key) { + assert(key); + + /* Check if this is a PTR resource key used in Service Instance + * Enumeration as described in RFC6763 § 4.1, excluding selective + * service names described in RFC6763 § 7.1. */ + + if (key->type != DNS_TYPE_PTR) + return false; + + const char *name = dns_resource_key_name(key); + if (dns_name_parent(&name) <= 0) + return false; + + return dns_name_equal(name, "_tcp.local") || dns_name_equal(name, "_udp.local"); +} + int dns_resource_key_equal(const DnsResourceKey *a, const DnsResourceKey *b) { int r; |