[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4102 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Thu Oct 14 10:34:15 CEST 2010


Author: matthijs
Date: 2010-10-14 10:34:14 +0200 (Thu, 14 Oct 2010)
New Revision: 4102

Modified:
   trunk/OpenDNSSEC/signer/src/signer/rrset.c
   trunk/OpenDNSSEC/signer/src/signer/zonelist.c
   trunk/OpenDNSSEC/signer/src/signer/zonelist.h
Log:
lookup a zone in zonelist by name
tweak rrset.c file



Modified: trunk/OpenDNSSEC/signer/src/signer/rrset.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/rrset.c	2010-10-14 07:58:16 UTC (rev 4101)
+++ trunk/OpenDNSSEC/signer/src/signer/rrset.c	2010-10-14 08:34:14 UTC (rev 4102)
@@ -586,7 +586,7 @@
             ldns_rr_free(rrsigs->rr);
             se_free((void*)rrsigs);
         } else {
-            /* A rule mismatched, refresh signature */
+            /* All rules ok, recycle signature */
             se_log_deeebug("recycle signature for RRset[%i] (refresh=%u, "
                 "signtime=%u, inception=%u, expiration=%u)", rrset->rr_type,
                 refresh, (uint32_t) signtime, inception, expiration);
@@ -776,8 +776,8 @@
 
             /* is there a signature with this algorithm already? */
             if (rrset_signed_with_algorithm(rrset, key->algorithm)) {
-                se_log_debug("skipping key %s for signing: RRset[%i] already "
-                    "has signature with same algorithm", key->locator);
+                se_log_deeebug("skipping key %s for signing: RRset[%i] "
+                    "already has signature with same algorithm", key->locator);
                 key = key->next;
                 continue;
             }
@@ -838,8 +838,6 @@
                 rrset->rrsig_count += 1;
                 rrset_log_rr(walk_rrsigs->rr, "+RRSIG", 6);
                 newsigs++;
-            } else {
-                se_log_deeebug("signature set is missing RRSIG record");
             }
             walk_rrsigs = walk_rrsigs->next;
         }

Modified: trunk/OpenDNSSEC/signer/src/signer/zonelist.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/zonelist.c	2010-10-14 07:58:16 UTC (rev 4101)
+++ trunk/OpenDNSSEC/signer/src/signer/zonelist.c	2010-10-14 08:34:14 UTC (rev 4102)
@@ -203,6 +203,34 @@
 
 
 /**
+ * Lookup zone by name.
+ *
+ */
+zone_type*
+zonelist_lookup_zone_by_name(zonelist_type* zonelist, const char* name)
+{
+    ldns_rbnode_t* node = LDNS_RBTREE_NULL;
+    zone_type* zone = NULL;
+
+    se_log_assert(zonelist);
+    se_log_assert(zonelist->zones);
+    se_log_assert(name);
+
+    if (zonelist->zones) {
+        node = ldns_rbtree_first(zonelist->zones);
+    }
+    while (node != LDNS_RBTREE_NULL) {
+        zone = (zone_type*) node->key;
+        if (se_strcmp(zone->name, name) == 0) {
+            return zone;
+        }
+        node = ldns_rbtree_next(node);
+    }
+    return NULL;
+}
+
+
+/**
  * Add zone.
  *
  */

Modified: trunk/OpenDNSSEC/signer/src/signer/zonelist.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/zonelist.h	2010-10-14 07:58:16 UTC (rev 4101)
+++ trunk/OpenDNSSEC/signer/src/signer/zonelist.h	2010-10-14 08:34:14 UTC (rev 4102)
@@ -81,6 +81,17 @@
 void zonelist_unlock(zonelist_type* zonelist);
 
 /**
+ * Lookup zone by name.
+ * \param[in] zonelist zone list
+ * \param[in] name zone name
+ * \return zone_type* zone if found
+ *
+ */
+zone_type* zonelist_lookup_zone_by_name(zonelist_type* zonelist,
+    const char* name);
+
+
+/**
  * Add zone to zone list.
  * \param[in] zonelist zone list
  * \param[in] zone zone to add




More information about the Opendnssec-commits mailing list