summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-02-16 17:00:48 +0100
committerTobias Klauser <tklauser@distanz.ch>2018-02-16 17:00:48 +0100
commit4dc24d0ecf7333ce139a8b8fb2e8477e14bfe092 (patch)
tree9bc187a20472039dbaa2a3ac59eeb1014b588f6a
parent731920807329ef1a6b26790296aa2c079435f18e (diff)
llmnrd: ignore queries with TC bit set
As per RFC 4795, section 2.1.1: The 'TC' bit MUST NOT be set in an LLMNR query and, if set, is ignored by an LLMNR responder. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--llmnr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/llmnr.c b/llmnr.c
index dc4b72a..2afdca6 100644
--- a/llmnr.c
+++ b/llmnr.c
@@ -204,8 +204,8 @@ static void llmnr_packet_process(unsigned int ifindex, const uint8_t *pktbuf, si
flags = ntohs(hdr->flags);
qdcount = ntohs(hdr->qdcount);
- /* Query invalid as per RFC 4795, section 2.1.1? */
- if (((flags & (LLMNR_F_QR | LLMNR_F_OPCODE)) != 0) ||
+ /* Query invalid as per RFC 4795, section 2.1.1 */
+ if (((flags & (LLMNR_F_QR | LLMNR_F_OPCODE | LLMNR_F_TC)) != 0) ||
qdcount != 1 || hdr->ancount != 0 || hdr->nscount != 0)
return;