summaryrefslogtreecommitdiff
path: root/src/dns-manager
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2012-09-06 11:40:52 +0200
committerJiří Klimeš <jklimes@redhat.com>2012-09-06 11:40:52 +0200
commit585564b9f5bdc85739e8c2115c29d15fb58477a6 (patch)
treef506c32519f470eb776ebb2cda71f2d0d3c3c921 /src/dns-manager
parentbafd97b0875619c3881284151e7bca5be8fb672b (diff)
downloadNetworkManager-585564b9f5bdc85739e8c2115c29d15fb58477a6.tar.gz
dnsmasq: don't crash when there are no nameservers in IP config (rh #768531)
Diffstat (limited to 'src/dns-manager')
-rw-r--r--src/dns-manager/nm-dns-dnsmasq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c
index 9090e26bc6..5d37e3749b 100644
--- a/src/dns-manager/nm-dns-dnsmasq.c
+++ b/src/dns-manager/nm-dns-dnsmasq.c
@@ -79,6 +79,9 @@ add_ip4_config (GString *str, NMIP4Config *ip4, gboolean split)
if (split) {
char **domains, **iter;
+ if (nm_ip4_config_get_num_nameservers (ip4) == 0)
+ return FALSE;
+
/* FIXME: it appears that dnsmasq can only handle one nameserver
* per domain (and the manpage says this too) so only use the first
* nameserver here.
@@ -188,6 +191,9 @@ add_ip6_config (GString *str, NMIP6Config *ip6, gboolean split, const char *ifac
gboolean added = FALSE;
if (split) {
+ if (nm_ip6_config_get_num_nameservers (ip6) == 0)
+ return FALSE;
+
/* FIXME: it appears that dnsmasq can only handle one nameserver
* per domain (at the manpage seems to indicate that) so only use
* the first nameserver here.