After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767174 - DNS missing for IPv6 and CIDR Legacy IP ranges [bg/dnsmasq-rdns-bgo767174]
DNS missing for IPv6 and CIDR Legacy IP ranges [bg/dnsmasq-rdns-bgo767174]
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review
 
 
Reported: 2016-06-02 16:33 UTC by David Woodhouse
Modified: 2016-06-07 09:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Woodhouse 2016-06-02 16:33:29 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
Comment 1 Beniamino Galvani 2016-06-03 20:18:56 UTC
(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.
Comment 2 David Woodhouse 2016-06-03 22:23:34 UTC
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.
Comment 3 Dan Williams 2016-06-04 16:12:02 UTC
LGTM
Comment 4 Thomas Haller 2016-06-06 22:56:27 UTC
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!
Comment 5 Beniamino Galvani 2016-06-07 09:53:35 UTC
(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