Discussion:
[Dnsmasq-discuss] Reverse IPv6 domain issue
Paul Maddock
2018-06-08 23:47:59 UTC
Permalink
Hi,

I think I've come across a bug with how the domain is determined for reverse
lookups for IPv6 addresses. Having set a domain config with my domain name and
IPv6 prefix I was correctly seeing the domain passed to the clients via DHCPv6,
but DNS lookups on the IPv6 returned my fallback domain.

Having checked the source code I think the problem is in the read_leases
function. For IPv6 is appears to be trying to find the domain based on the
hwaddr instead of the IPv6 address. I've recompiled with the below patch and
I'm now getting the expected domain.

Please review and apply the fix as necessary.


--- dnsmasq/src/lease.c 2018-06-08 22:32:29.486011028 +0000
+++ dnsmasq/src/lease.c 2018-06-08 22:33:31.118012520 +0000
@@ -87,7 +87,7 @@
if ((lease = lease6_allocate(&addr.addr.addr6, lease_type)))
{
lease_set_iaid(lease, strtoul(s, NULL, 10));
- domain = get_domain6((struct in6_addr *)lease->hwaddr);
+ domain = get_domain6(&lease->addr6);
}
}
#endif


Regards,

Paul
Simon Kelley
2018-06-12 15:40:19 UTC
Permalink
Tracing back through git, that seems to have been broken from birth.

Patch applied. Many thanks.

Simon.
Post by Paul Maddock
Hi,
I think I've come across a bug with how the domain is determined for reverse
lookups for IPv6 addresses. Having set a domain config with my domain name and
IPv6 prefix I was correctly seeing the domain passed to the clients via DHCPv6,
but DNS lookups on the IPv6 returned my fallback domain.
Having checked the source code I think the problem is in the read_leases
function. For IPv6 is appears to be trying to find the domain based on the
hwaddr instead of the IPv6 address. I've recompiled with the below patch and
I'm now getting the expected domain.
Please review and apply the fix as necessary.
--- dnsmasq/src/lease.c 2018-06-08 22:32:29.486011028 +0000
+++ dnsmasq/src/lease.c 2018-06-08 22:33:31.118012520 +0000
@@ -87,7 +87,7 @@
if ((lease = lease6_allocate(&addr.addr.addr6, lease_type)))
{
lease_set_iaid(lease, strtoul(s, NULL, 10));
- domain = get_domain6((struct in6_addr *)lease->hwaddr);
+ domain = get_domain6(&lease->addr6);
}
}
#endif
Regards,
Paul
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...