diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2021-02-19 13:29:02 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-24 17:17:03 +0100 |
commit | 2aaf3765974c9f340c0c3d705e9f0609073cf83c (patch) | |
tree | 54df4aa5f44abd8efecebc31fd7e97267f3d55dd /src/resolve/resolved-dns-packet.c | |
parent | resolved: don't discard mDNS packets with ip6.arpa RRs (diff) | |
download | systemd-2aaf3765974c9f340c0c3d705e9f0609073cf83c.tar.xz systemd-2aaf3765974c9f340c0c3d705e9f0609073cf83c.zip |
resolved: don't discard mDNS queries with bad flags
Even though RFC 6762 specifies these bits MUST be zero, it also says they MUST
be ignored on reception.
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index a51514a8de..9778f5ee6b 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -326,13 +326,10 @@ int dns_packet_validate_query(DnsPacket *p) { break; case DNS_PROTOCOL_MDNS: - /* RFC 6762, Section 18 */ - if (DNS_PACKET_AA(p) != 0 || - DNS_PACKET_RD(p) != 0 || - DNS_PACKET_RA(p) != 0 || - DNS_PACKET_AD(p) != 0 || - DNS_PACKET_CD(p) != 0 || - DNS_PACKET_RCODE(p) != 0) + /* RFC 6762, Section 18 specifies that messages with non-zero RCODE + * must be silently ignored, and that we must ignore the values of + * AA, RD, RA, AD, and CD bits. */ + if (DNS_PACKET_RCODE(p) != 0) return -EBADMSG; break; |