about summary refs log tree commit diff
path: root/src/core/dnsmasq/nm-dnsmasq-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/dnsmasq/nm-dnsmasq-manager.c')
-rw-r--r--src/core/dnsmasq/nm-dnsmasq-manager.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/dnsmasq/nm-dnsmasq-manager.c b/src/core/dnsmasq/nm-dnsmasq-manager.c
index be463da3..d245d5d3 100644
--- a/src/core/dnsmasq/nm-dnsmasq-manager.c
+++ b/src/core/dnsmasq/nm-dnsmasq-manager.c
@@ -104,7 +104,6 @@ create_dm_cmd_line(const char           *iface,
     gs_free char                 *error_desc = NULL;
     const char                   *dm_binary;
     const NMPlatformIP4Address   *listen_address;
-    const in_addr_t              *ipv4arr;
     const char *const            *strarr;
     guint                         n;
     guint                         i;
@@ -147,7 +146,7 @@ create_dm_cmd_line(const char           *iface,
      */
     nm_strv_ptrarray_add_string_dup(cmd, "--strict-order");
 
-    _nm_utils_inet4_ntop(listen_address->address, listen_address_s);
+    nm_inet4_ntop(listen_address->address, listen_address_s);
 
     nm_strv_ptrarray_add_string_concat(cmd, "--listen-address=", listen_address_s);
 
@@ -163,13 +162,18 @@ create_dm_cmd_line(const char           *iface,
         nm_strv_ptrarray_add_string_concat(cmd, "--dhcp-option=option:router,", listen_address_s);
     }
 
-    ipv4arr = nm_l3_config_data_get_nameservers(l3cd, AF_INET, &n);
+    strarr = nm_l3_config_data_get_nameservers(l3cd, AF_INET, &n);
     if (n > 0) {
         nm_gstring_prepare(&s);
         g_string_append(s, "--dhcp-option=option:dns-server");
         for (i = 0; i < n; i++) {
+            in_addr_t a;
+
+            if (!nm_utils_dnsname_parse_assert(AF_INET, strarr[i], NULL, &a, NULL))
+                continue;
+
             g_string_append_c(s, ',');
-            g_string_append(s, _nm_utils_inet4_ntop(ipv4arr[i], sbuf_addr));
+            g_string_append(s, nm_inet4_ntop(a, sbuf_addr));
         }
         nm_strv_ptrarray_take_gstring(cmd, &s);
     }