dryang / rpms / systemd

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