]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: tweak cmsg calculation 15942/head
authorLennart Poettering <lennart@poettering.net>
Wed, 27 May 2020 17:38:38 +0000 (19:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 May 2020 20:40:59 +0000 (22:40 +0200)
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.

src/resolve/resolved-dns-stream.c

index bbaffc165ac3b9eb26818095f1e8c24427400129..1e2ff05c3e527285b21542d1876230974cc95fb5 100644 (file)
@@ -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;