naccyde / rpms / systemd

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