From 349a981d32058455c5844080272b5d8886717575 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 8 Dec 2017 14:33:40 +0200 Subject: [PATCH] networkd: Ignore DNS information when uplink is not managed (#7571) When another networking daemon or configuration is handling the uplink connection, systemd-networkd won't have a network configuration associated with the link, and therefore link->network will be NULL. An assert will be triggered later on in the code when link->network is NULL. --- src/network/networkd-radv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index 630e1dc476f..535454c4727 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -92,6 +92,11 @@ static int radv_set_dns(Link *link, Link *uplink) { goto set_dns; if (uplink) { + if (uplink->network == NULL) { + log_link_debug(uplink, "Cannot fetch DNS servers as uplink interface is not managed by us"); + return 0; + } + r = radv_get_ip6dns(uplink->network, &dns, &n_dns); if (r > 0) goto set_dns; @@ -125,6 +130,11 @@ static int radv_set_domains(Link *link, Link *uplink) { goto set_domains; if (uplink) { + if (uplink->network == NULL) { + log_link_debug(uplink, "Cannot fetch DNS search domains as uplink interface is not managed by us"); + return 0; + } + search_domains = uplink->network->search_domains; if (search_domains) goto set_domains;