diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:19:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:19:38 +0000 |
commit | 68aafb2658b298c23ed1725b69f5474bee5ee38c (patch) | |
tree | c383770976489dbeeef85ef7bc668da64a242b14 /src/resolve/resolved-dns-rr.c | |
parent | Adding upstream version 252.23. (diff) | |
download | systemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.tar.xz systemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.zip |
Adding upstream version 252.25.upstream/252.25
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/resolve/resolved-dns-rr.c')
-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; |