nss-resolve: shortcut fixing of ifindex if it's zero anyway

This commit is contained in:
Lennart Poettering
2021-02-05 18:46:18 +01:00
parent 6da52ca861
commit 425ed13991

View 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. */