/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if HAVE_GCRYPT
-#include <gcrypt.h>
+# include <gcrypt.h>
#endif
#include "alloc-util.h"
h = DNS_PACKET_HEADER(p);
- switch(p->protocol) {
+ switch (p->protocol) {
case DNS_PROTOCOL_LLMNR:
assert(!truncated);
static const uint8_t rfc6975[] = {
0, 5, /* OPTION_CODE: DAU */
-#if HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600
+#if PREFER_OPENSSL || (HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600)
0, 7, /* LIST_LENGTH */
#else
0, 6, /* LIST_LENGTH */
DNSSEC_ALGORITHM_RSASHA512,
DNSSEC_ALGORITHM_ECDSAP256SHA256,
DNSSEC_ALGORITHM_ECDSAP384SHA384,
-#if HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600
+#if PREFER_OPENSSL || (HAVE_GCRYPT && GCRYPT_VERSION_NUMBER >= 0x010600)
DNSSEC_ALGORITHM_ED25519,
#endif
r = dns_packet_append_raw_string(p, NULL, 0, NULL);
if (r < 0)
goto fail;
- } else {
- DnsTxtItem *i;
-
+ } else
LIST_FOREACH(items, i, rr->txt.items) {
r = dns_packet_append_raw_string(p, i->data, i->length, NULL);
if (r < 0)
goto fail;
}
- }
r = 0;
break;
/* Remember this RR, so that we can potentially merge its ->key object with the
* next RR. Note that we only do this if we actually decided to keep the RR around.
*/
- dns_resource_record_unref(previous);
- previous = dns_resource_record_ref(rr);
+ DNS_RR_REPLACE(previous, dns_resource_record_ref(rr));
}
if (bad_opt) {
usec_t k;
int r;
- k = now(clock_boottime_or_monotonic());
+ k = now(CLOCK_BOOTTIME);
assert(k >= timestamp);
k -= timestamp;