blob: 578839364c6250c83a1e2d0832576e1e5faf6710 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
diff --git a/avahi-core/server.c b/avahi-core/server.c
index 453db09..8187690 100644
--- a/avahi-core/server.c
+++ b/avahi-core/server.c
@@ -844,7 +844,7 @@ static int originates_from_local_legacy_unicast_socket(AvahiServer *s, const Ava
if (getsockname(s->fd_legacy_unicast_ipv4, (struct sockaddr*) &lsa, &l) != 0)
avahi_log_warn("getsockname(): %s", strerror(errno));
else
- return lsa.sin_port == port;
+ return avahi_port_from_sockaddr((struct sockaddr*) &lsa) == port;
}
@@ -855,7 +855,7 @@ static int originates_from_local_legacy_unicast_socket(AvahiServer *s, const Ava
if (getsockname(s->fd_legacy_unicast_ipv6, (struct sockaddr*) &lsa, &l) != 0)
avahi_log_warn("getsockname(): %s", strerror(errno));
else
- return lsa.sin6_port == port;
+ return avahi_port_from_sockaddr((struct sockaddr*) &lsa) == port;
}
return 0;
|