]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nss-resolve: shortcut fixing of ifindex if it's zero anyway 18482/head
authorLennart Poettering <lennart@poettering.net>
Fri, 5 Feb 2021 17:46:18 +0000 (18:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Feb 2021 17:46:18 +0000 (18:46 +0100)
src/nss-resolve/nss-resolve.c

index 458eb487a5f0531856d3714642a22b9d3600cca1..fb1d61fea98d95d8ea23a1cc86674aa7250e247c 100644 (file)
@@ -68,7 +68,7 @@ static int connect_to_resolved(Varlink **ret) {
 static uint32_t ifindex_to_scopeid(int family, const void *a, int ifindex) {
         struct in6_addr in6;
 
-        if (family != AF_INET6)
+        if (family != AF_INET6 || ifindex == 0)
                 return 0;
 
         /* Some apps can't deal with the scope ID attached to non-link-local addresses. Hence, let's suppress that. */