teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0495-resolved-tweak-cmsg-calculation.patch

21255d
From 6ece87bef14ac5741fc870644504737b00607546 Mon Sep 17 00:00:00 2001
21255d
From: Lennart Poettering <lennart@poettering.net>
21255d
Date: Wed, 27 May 2020 19:38:38 +0200
21255d
Subject: [PATCH] resolved: tweak cmsg calculation
21255d
21255d
We ask for the TTL, then have enough space for it.
21255d
21255d
We probably can drop the extra cmsg space now, but let's figure that out
21255d
another time, since the extra cmsg space is used elsewhere in resolved
21255d
as well.
21255d
21255d
(cherry picked from commit 08ab18618ec59022582f1513c0718ba369f5ba85)
21255d
21255d
Related: #1887181
21255d
---
21255d
 src/resolve/resolved-dns-stream.c | 1 +
21255d
 1 file changed, 1 insertion(+)
21255d
21255d
diff --git a/src/resolve/resolved-dns-stream.c b/src/resolve/resolved-dns-stream.c
21255d
index 066daef96e..555e200a23 100644
21255d
--- a/src/resolve/resolved-dns-stream.c
21255d
+++ b/src/resolve/resolved-dns-stream.c
21255d
@@ -70,6 +70,7 @@ static int dns_stream_identify(DnsStream *s) {
21255d
         union {
21255d
                 struct cmsghdr header; /* For alignment */
21255d
                 uint8_t buffer[CMSG_SPACE(MAXSIZE(struct in_pktinfo, struct in6_pktinfo))
21255d
+                               + CMSG_SPACE(int) + /* for the TTL */
21255d
                                + EXTRA_CMSG_SPACE /* kernel appears to require extra space */];
21255d
         } control;
21255d
         struct msghdr mh = {};