resolved: IPV6_UNICAST_IF may fail if we already are bound to a device, like we are for link-local addresses

This commit is contained in:
Lennart Poettering 2014-08-01 19:25:06 +02:00
parent 9198814968
commit 747c0ff564

View file

@ -172,11 +172,11 @@ static int dns_stream_identify(DnsStream *s) {
if (s->local.sa.sa_family == AF_INET) {
r = setsockopt(s->fd, IPPROTO_IP, IP_UNICAST_IF, &ifindex, sizeof(ifindex));
if (r < 0)
return -errno;
log_debug("Failed to invoke IP_UNICAST_IF: %m");
} else if (s->local.sa.sa_family == AF_INET6) {
r = setsockopt(s->fd, IPPROTO_IPV6, IPV6_UNICAST_IF, &ifindex, sizeof(ifindex));
if (r < 0)
return -errno;
log_debug("Failed to invoke IPV6_UNICAST_IF: %m");
}
}