diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-10-27 18:33:29 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-09 17:52:19 +0100 |
commit | 42df95324790b4045cea92111e5ff89dc040efce (patch) | |
tree | 1404e3c1000c2d7e994f0a230dd0b25cef44742f /src/resolve/resolved-dns-transaction.h | |
parent | resolved: add helper dns_packet_dup() for duplicating packets (diff) | |
download | systemd-42df95324790b4045cea92111e5ff89dc040efce.tar.xz systemd-42df95324790b4045cea92111e5ff89dc040efce.zip |
resolved: introduce dns_transaction_key() helper for getting RR key for transaction
This is a simple search&replace excercise: instead of accessing the
"key" field of the transaction directly, let's use a small inline helper
that does this for us.
This appears pointless for now, but this will become useful later when
we introduce "bypass" transactions, that reuse the original client DNS
packet for queries instead of synthesizing a packet of our own. In that
case transactions either have regular "key" field initialized as before,
or the "bypass" packet field instead. The new dns_transaction_key()
helper allows us to hide the differences for most cases as we can later
teach it to access the "bypass" packet's question key transparently.
No change in behaviour.
Diffstat (limited to 'src/resolve/resolved-dns-transaction.h')
-rw-r--r-- | src/resolve/resolved-dns-transaction.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-transaction.h b/src/resolve/resolved-dns-transaction.h index 7f0b8e7847..9a3b54061c 100644 --- a/src/resolve/resolved-dns-transaction.h +++ b/src/resolve/resolved-dns-transaction.h @@ -150,6 +150,12 @@ void dns_transaction_notify(DnsTransaction *t, DnsTransaction *source); int dns_transaction_validate_dnssec(DnsTransaction *t); int dns_transaction_request_dnssec_keys(DnsTransaction *t); +static inline DnsResourceKey *dns_transaction_key(DnsTransaction *t) { + assert(t); + + return t->key; +} + const char* dns_transaction_state_to_string(DnsTransactionState p) _const_; DnsTransactionState dns_transaction_state_from_string(const char *s) _pure_; |