mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-24 20:32:00 +00:00
Remove duplicate configured trust anchors.
Well-known trust anchors can turn up in multiple config files. Leaving the duplicates makes logging messy and costs some CPU checking the same DS twice.
This commit is contained in:
2 files changed
+22
-4
No files matched your search
+1
-1
@@ -1600,7 +1600,7 @@ void cache_reload(void)
|
|||||||
|
|
||||||
#ifdef HAVE_DNSSEC
|
#ifdef HAVE_DNSSEC
|
||||||
for (ds = daemon->ds; ds; ds = ds->next)
|
for (ds = daemon->ds; ds; ds = ds->next)
|
||||||
if ((cache = get_config_crec()))
|
if (ds->name && (cache = get_config_crec()))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!(cache->addr.ds.keydata = blockdata_alloc(ds->digest, ds->digestlen)))
|
if (!(cache->addr.ds.keydata = blockdata_alloc(ds->digest, ds->digestlen)))
|
||||||
|
|||||||
+21
-3
@@ -946,9 +946,27 @@ int main (int argc, char **argv)
|
|||||||
my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until system time valid"));
|
my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until system time valid"));
|
||||||
|
|
||||||
for (ds = daemon->ds; ds; ds = ds->next)
|
for (ds = daemon->ds; ds; ds = ds->next)
|
||||||
my_syslog(LOG_INFO,
|
{
|
||||||
ds->digestlen == 0 ? _("configured with negative trust anchor for %s") : _("configured with trust anchor for %s keytag %u"),
|
struct ds_config *ds1;
|
||||||
ds->name[0] == 0 ? "<root>" : ds->name, ds->keytag);
|
|
||||||
|
for (ds1 = ds->next; ds1; ds1 = ds1->next)
|
||||||
|
if (strcmp(ds->name, ds1->name) == 0 &&
|
||||||
|
ds->digestlen == ds1->digestlen &&
|
||||||
|
(ds->digestlen == 0 ||
|
||||||
|
(ds->algo == ds1->algo &&
|
||||||
|
ds->keytag == ds1->keytag &&
|
||||||
|
ds->digest_type == ds1->digest_type &&
|
||||||
|
memcmp(ds->digest, ds1->digest, ds->digestlen) == 0)))
|
||||||
|
{
|
||||||
|
ds->name = NULL; /* Mark as duplicate */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ds->name)
|
||||||
|
my_syslog(LOG_INFO,
|
||||||
|
ds->digestlen == 0 ? _("configured with negative trust anchor for %s") : _("configured with trust anchor for %s keytag %u"),
|
||||||
|
ds->name[0] == 0 ? "<root>" : ds->name, ds->keytag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user