diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-02-02 23:49:49 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-01-28 18:35:02 -0500 |
commit | 99e5ca6d8bf140444a15c0588fe797b27da5538c (patch) | |
tree | c6c438001a000f099bcaeb82f7985610051cd08a /src/resolve/resolved-dns-rr.c | |
parent | cfb90da3dc579e2f9408bc0e04a71c82dd28ac71 (diff) |
resolved: expand flags field in DNSKEY records
Diffstat (limited to 'src/resolve/resolved-dns-rr.c')
-rw-r--r-- | src/resolve/resolved-dns-rr.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index dd2ca2b06c..83dce76565 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -971,14 +971,16 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) { case DNS_TYPE_DNSKEY: { _cleanup_free_ char *alg = NULL; - int n; + char *ss; + int n, n1; r = dnssec_algorithm_to_string_alloc(rr->dnskey.algorithm, &alg); if (r < 0) return NULL; - r = asprintf(&s, "%s %u %u %s %n", + r = asprintf(&s, "%s %n%u %u %s %n", k, + &n1, rr->dnskey.flags, rr->dnskey.protocol, alg, @@ -992,6 +994,18 @@ const char *dns_resource_record_to_string(DnsResourceRecord *rr) { if (r < 0) return NULL; + r = asprintf(&ss, "%s\n" + "%*s-- Flags:%s%s%s", + s, + n1, "", + rr->dnskey.flags & DNSKEY_FLAG_SEP ? " SEP" : "", + rr->dnskey.flags & DNSKEY_FLAG_REVOKE ? " REVOKE" : "", + rr->dnskey.flags & DNSKEY_FLAG_ZONE_KEY ? " ZONE_KEY" : ""); + if (r < 0) + return NULL; + free(s); + s = ss; + break; } |