From: Lennart Poettering Date: Wed, 27 May 2020 17:38:38 +0000 (+0200) Subject: resolved: tweak cmsg calculation X-Git-Tag: v246-rc1~258^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15942%2Fhead;p=thirdparty%2Fsystemd.git resolved: tweak cmsg calculation We ask for the TTL, then have enough space for it. We probably can drop the extra cmsg space now, but let's figure that out another time, since the extra cmsg space is used elsewhere in resolved as well. --- diff --git a/src/resolve/resolved-dns-stream.c b/src/resolve/resolved-dns-stream.c index bbaffc165ac..1e2ff05c3e5 100644 --- a/src/resolve/resolved-dns-stream.c +++ b/src/resolve/resolved-dns-stream.c @@ -88,6 +88,7 @@ static int dns_stream_complete(DnsStream *s, int error) { static int dns_stream_identify(DnsStream *s) { CMSG_BUFFER_TYPE(CMSG_SPACE(MAXSIZE(struct in_pktinfo, struct in6_pktinfo)) + + CMSG_SPACE(int) + /* for the TTL */ + EXTRA_CMSG_SPACE /* kernel appears to require extra space */) control; struct msghdr mh = {}; struct cmsghdr *cmsg;