+ if (a->proto == AVAHI_PROTO_INET) {
+ uint32_t n = ntohl(a->data.ipv4.address);
+ return (n & IPV4LL_NETMASK) == IPV4LL_NETWORK;
+ }
+ else if (a->proto == AVAHI_PROTO_INET6) {
+ unsigned n = (a->data.ipv6.address[0] << 8) | (a->data.ipv6.address[1] << 0);
+ return (n & IPV6LL_NETMASK) == IPV6LL_NETWORK;
+ }
+
+ return 0;
+}