diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-10-27 14:28:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-10-28 10:00:28 +0100 |
commit | 1ed314087fab3988f3221b1b736a7e711f174349 (patch) | |
tree | e0ebb573c8e8f525cfac46fa0c8539d7a34ff20e /src/resolve/resolved-dns-packet.c | |
parent | Merge pull request #17455 from poettering/packet-auxdata (diff) | |
download | systemd-1ed314087fab3988f3221b1b736a7e711f174349.tar.xz systemd-1ed314087fab3988f3221b1b736a7e711f174349.zip |
resolved: use structured initialization everywhere
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 6224039992..05fa88ec89 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -75,12 +75,16 @@ int dns_packet_new( if (!p) return -ENOMEM; - p->size = p->rindex = DNS_PACKET_HEADER_SIZE; - p->allocated = a; - p->max_size = max_size; - p->protocol = protocol; - p->opt_start = p->opt_size = (size_t) -1; - p->n_ref = 1; + *p = (DnsPacket) { + .n_ref = 1, + .protocol = protocol, + .size = DNS_PACKET_HEADER_SIZE, + .rindex = DNS_PACKET_HEADER_SIZE, + .allocated = a, + .max_size = max_size, + .opt_start = (size_t) -1, + .opt_size = (size_t) -1, + }; *ret = p; |