ndisc: honor IPv6AcceptRA.UseDNS when parsing RA options (#5071)
authorCédric Schieli <cschieli@gmail.com>
Mon, 16 Jan 2017 17:23:26 +0000 (18:23 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 16 Jan 2017 17:23:26 +0000 (12:23 -0500)
RDNSS and DNSLL options received in RA are always used, possibly breaking the resolution of private domains hosted on a local DNS server. When setting UseDNS=no in a [IPv6AcceptRA] section of a .network file, both RDNSS and DNSLL options in received RA should be ignored.

Fixes: #5040

src/network/networkd-ndisc.c

index bc80c69..4fd5d8a 100644 (file)
@@ -587,11 +587,13 @@ static void ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
                         break;
 
                 case SD_NDISC_OPTION_RDNSS:
-                        ndisc_router_process_rdnss(link, rt);
+                        if (link->network->ipv6_accept_ra_use_dns)
+                                ndisc_router_process_rdnss(link, rt);
                         break;
 
                 case SD_NDISC_OPTION_DNSSL:
-                        ndisc_router_process_dnssl(link, rt);
+                        if (link->network->ipv6_accept_ra_use_dns)
+                                ndisc_router_process_dnssl(link, rt);
                         break;
                 }