dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ac3a84
From 39974d2ee3b1e514e9d2cf25e4a11447d4dfee53 Mon Sep 17 00:00:00 2001
ac3a84
From: Lennart Poettering <lennart@poettering.net>
ac3a84
Date: Fri, 18 Nov 2022 16:52:01 +0100
ac3a84
Subject: [PATCH] resolved: use right conditionalization when setting unicast
ac3a84
 ifindex on UDP sockets
ac3a84
ac3a84
(cherry picked from commit 5faaed5b62d5ed88d8df2802c5ab4d3ab2eb755a)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 src/resolve/resolved-dns-scope.c | 2 +-
ac3a84
 1 file changed, 1 insertion(+), 1 deletion(-)
ac3a84
ac3a84
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
ac3a84
index 852829569d..4f744499aa 100644
ac3a84
--- a/src/resolve/resolved-dns-scope.c
ac3a84
+++ b/src/resolve/resolved-dns-scope.c
ac3a84
@@ -424,7 +424,7 @@ static int dns_scope_socket(
ac3a84
                         return r;
ac3a84
         }
ac3a84
 
ac3a84
-        if (s->link) {
ac3a84
+        if (ifindex != 0) {
ac3a84
                 r = socket_set_unicast_if(fd, sa.sa.sa_family, ifindex);
ac3a84
                 if (r < 0)
ac3a84
                         return r;