Skip to content

Commit

Permalink
controller: Ignore DNS queries with RRs
Browse files Browse the repository at this point in the history
DNS queries with optional records (RRs), for example, with
cookies for EDNS, are not supported by the OVN resolver.
Trying to reply will result in mangled responses that
clients do not understand - the ANSWER section will
contain an incorrect option.

Instead, just return early when one is present, which
will trigger a negative response and cause clients to
go to the upstream forwarder, hopefully resulting in a
successful query.

In our testing, the resolver only retries if the
response is correctly formatted, which now happens
with this change.

Reported-at: #192
Reported-by: Nicolas Bock <nicolasbock@gmail.com>
Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit 4b10571)
  • Loading branch information
brianphaley authored and dceara committed May 30, 2023
1 parent 56ba43e commit 4334ce3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controller/pinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,13 @@ pinctrl_handle_dns_lookup(
goto exit;
}

/* Check if there is an additional record present, which is unsupported */
if (in_dns_header->arcount) {
VLOG_DBG_RL(&rl, "Received DNS query with additional records, which"
" is unsupported");
goto exit;
}

struct udp_header *in_udp = dp_packet_l4(pkt_in);
size_t udp_len = ntohs(in_udp->udp_len);
size_t l4_len = dp_packet_l4_size(pkt_in);
Expand Down

0 comments on commit 4334ce3

Please sign in to comment.