diff --git a/src/rdisc/nm-lndp-rdisc.c b/src/rdisc/nm-lndp-rdisc.c index 6afe60c7f..04b52067f 100644 --- a/src/rdisc/nm-lndp-rdisc.c +++ b/src/rdisc/nm-lndp-rdisc.c @@ -162,6 +162,10 @@ add_dns_server (NMRDisc *rdisc, const NMRDiscDNSServer *new) } } + /* DNS server should no longer be used */ + if (new->lifetime == 0) + return FALSE; + g_array_insert_val (rdisc->dns_servers, i, *new); return TRUE; } @@ -187,6 +191,10 @@ add_dns_domain (NMRDisc *rdisc, const NMRDiscDNSDomain *new) } } + /* Domain should no longer be used */ + if (new->lifetime == 0) + return FALSE; + g_array_insert_val (rdisc->dns_domains, i, *new); item = &g_array_index (rdisc->dns_domains, NMRDiscDNSDomain, i); item->domain = g_strdup (new->domain);