summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-stream.h
diff options
context:
space:
mode:
authorJoan Bruguera <joanbrugueram@gmail.com>2022-01-31 21:28:21 +0100
committerJoan Bruguera <joanbrugueram@gmail.com>2022-02-01 19:24:40 +0100
commiteff107736e17bfe43680c42ae39baa3d41fb4715 (patch)
tree360320b21decdc3533fe415bafa3f7588e518ceb /src/resolve/resolved-dns-stream.h
parentbb7031bcaaf933da408250c00a1a524b0b8e6383 (diff)
downloadsystemd-eff107736e17bfe43680c42ae39baa3d41fb4715.tar.gz
resolved: Make event flags logic robust for DoT
Since when handling a DNS over TLS stream, the TLS library can override the requested events through dnstls_events for handshake/shutdown purposes, obtaining the event flags through sd_event_source_get_io_events and checking for EPOLLIN or EPOLLOUT does not really tell us whether we want to read/write a packet. Instead, it could just be OpenSSL/GnuTLS doing something else. To make the logic more robust (and simpler), save the flags that tell us whether we want to read/write a packet, and check them instead of the IO flags. (& use uint32_t for the flags like in sd_event_source_set_io_events prototype)
Diffstat (limited to 'src/resolve/resolved-dns-stream.h')
-rw-r--r--src/resolve/resolved-dns-stream.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-stream.h b/src/resolve/resolved-dns-stream.h
index 1c606365cd..ba4a59e41c 100644
--- a/src/resolve/resolved-dns-stream.h
+++ b/src/resolve/resolved-dns-stream.h
@@ -61,6 +61,7 @@ struct DnsStream {
uint32_t ttl;
bool identified;
bool packet_received; /* At least one packet is received. Used by LLMNR. */
+ uint32_t requested_events;
/* only when using TCP fast open */
union sockaddr_union tfo_address;
@@ -68,7 +69,7 @@ struct DnsStream {
#if ENABLE_DNS_OVER_TLS
DnsTlsStreamData dnstls_data;
- int dnstls_events;
+ uint32_t dnstls_events;
#endif
sd_event_source *io_event_source;