The dns_reply_a() function appears to include *only* link-local IPv6
addresses. This seems wrong, and ends up publishing addresses which
can't be used to reach the host in question.

I believe the logic should be the other way around and we should be
*eliding* the link-local addresses but including the global ones.

With this fixed, I can run 'ubus call umdns hosts' on another AP in my
network and I see the correct global IPv6 address. Likewise, running
'ubus call umdns browse' shows the right address and I can set about
fixing https://github.com/berlin-open-wireless-lab/DAWN/issues/95

Fixes: https://bugs.openwrt.org/index.php?do=details&task_id=3167

diff --git a/dns.c b/dns.c
index 1d3362f..47c75ad 100644
--- a/dns.c
+++ b/dns.c
@@ -202,7 +202,7 @@ dns_reply_a(struct interface *iface, struct sockaddr *to, 
int ttl)
                if (ifa->ifa_addr->sa_family == AF_INET6) {
                        uint8_t ll_prefix[] = {0xfe, 0x80 };
                        sa6 = (struct sockaddr_in6 *) ifa->ifa_addr;
-                       if (!memcmp(&sa6->sin6_addr, &ll_prefix, 2))
+                       if (memcmp(&sa6->sin6_addr, &ll_prefix, 2))
                                dns_add_answer(TYPE_AAAA, (uint8_t *) 
&sa6->sin6_addr, 16, ttl);
                }
        }

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to