From 7a99f98b50b9788e22140c812f7be733dad0725a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 8 Nov 2018 12:29:38 +0900 Subject: [PATCH] network: make config_parse_radv_search_domains() log error in dns_name_apply_idna() --- src/network/networkd-network.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index f257ac6698b..fb4c519dbe8 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -1154,8 +1154,7 @@ int config_parse_radv_search_domains( assert(rvalue); for (;;) { - _cleanup_free_ char *w = NULL; - _cleanup_free_ char *idna = NULL; + _cleanup_free_ char *w = NULL, *idna = NULL; r = extract_first_word(&p, &w, NULL, 0); if (r == -ENOMEM) @@ -1168,11 +1167,15 @@ int config_parse_radv_search_domains( break; r = dns_name_apply_idna(w, &idna); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to apply IDNA to domain name '%s', ignoring: %m", w); + continue; + } if (r > 0) { r = strv_push(&n->router_search_domains, idna); if (r >= 0) idna = NULL; - } else if (r == 0) { + } else { r = strv_push(&n->router_search_domains, w); if (r >= 0) w = NULL;