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