GNOME Bugzilla – Bug 767174
DNS missing for IPv6 and CIDR Legacy IP ranges [bg/dnsmasq-rdns-bgo767174]
Last modified: 2016-06-07 09:53:35 UTC
If I have a VPN with fec0::/16 and 172.16.0.0/12 address ranges routed to it, I don't seem to get reverse DNS configured properly in dnsmasq. In nm-dns-utils.c we have nm_dns_utils_get_ip4_rdns_domains() which works only for /8, /16 and /24 subnets. We have no equivalent for IPv6. For Legacy IP, we need to handle CIDR. The 172.16.0.0/12 example would, for example, need to configure reverse DNS for all of 0.16.172.in-addr.arpa 1.16.172.in-addr.arpa 2.16.172.in-addr.arpa ... through to ... 30.16.172.in-addr.arpa 31.16.172.in-addr.arpa. For IPv6 we need the equivalent, so fec0:1234:5678:9ab0::/61 would result in 0.b.a.9.8.7.6.5.4.3.2.1.0.c.f.e.ip6.arpa 1.b.a.9.8.7.6.5.4.3.2.1.0.c.f.e.ip6.arpa ... 7.b.a.9.8.7.6.5.4.3.2.1.0.c.f.e.ip6.arpa
(In reply to David Woodhouse from comment #0) > For Legacy IP, we need to handle CIDR. The 172.16.0.0/12 example would, for > example, need to configure reverse DNS for all of > 0.16.172.in-addr.arpa > 1.16.172.in-addr.arpa > 2.16.172.in-addr.arpa > ... through to ... > 30.16.172.in-addr.arpa > 31.16.172.in-addr.arpa. Shouldn't they be: 16.172.in-addr.arpa to 31.172.in-addr.arpa ? Pushed branch bg/dnsmasq-rdns-bgo767174.
Yes, sorry they should.(In reply to Beniamino Galvani from comment #1) > Shouldn't they be: > 16.172.in-addr.arpa to 31.172.in-addr.arpa ? Yes, thanks.
LGTM
I would only not use GString for constructing the rdns name in nm_utils_get_reverse_dns_domains_ip4(). In the current form, that involves one throw-away slice allocation (GString) and several mallocs as the string buffer expands. The latter could be avoided via g_string_sized_new(), but how about the fixup instead? Either way, branch lgtm. Nice!
(In reply to Thomas Haller from comment #4) > I would only not use GString for constructing the rdns name in > nm_utils_get_reverse_dns_domains_ip4(). In the current form, that involves > one throw-away slice allocation (GString) and several mallocs as the string > buffer expands. The latter could be avoided via g_string_sized_new(), but > how about the fixup instead? Looks good. I've also changed the IPv6 function in the same way. Branch merged to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=ff3cd5aaf573324c7ff573cbd2a9c58d8a5d4f8c