mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 16:21:26 +03:00
resolve: use sockaddr_in_addr()
This commit is contained in:
parent
bb3b08ad98
commit
b1dea5cffa
@ -187,7 +187,7 @@ static int dns_stream_identify(DnsStream *s) {
|
||||
/* If we don't know the interface index still, we look for the
|
||||
* first local interface with a matching address. Yuck! */
|
||||
if (s->ifindex <= 0)
|
||||
s->ifindex = manager_find_ifindex(s->manager, s->local.sa.sa_family, s->local.sa.sa_family == AF_INET ? (union in_addr_union*) &s->local.in.sin_addr : (union in_addr_union*) &s->local.in6.sin6_addr);
|
||||
s->ifindex = manager_find_ifindex(s->manager, s->local.sa.sa_family, sockaddr_in_addr(&s->local.sa));
|
||||
|
||||
if (s->protocol == DNS_PROTOCOL_LLMNR && s->ifindex > 0) {
|
||||
/* Make sure all packets for this connection are sent on the same interface */
|
||||
|
Loading…
Reference in New Issue
Block a user