]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
update code documentation svn:NO TEST
authorMatthijs Mekking <matje@NLnetLabs.nl>
Tue, 6 Mar 2012 09:01:07 +0000 (09:01 +0000)
committerMatthijs Mekking <matje@NLnetLabs.nl>
Tue, 6 Mar 2012 09:01:07 +0000 (09:01 +0000)
dnssec_sign.c
util.c

index ec7b8d7a8ab80f06d6511ea341a4f91801d39d4f..88878bad0449ca8c5a1474ddf69bec2baf9e7c16 100644 (file)
@@ -1278,7 +1278,8 @@ ldns_dnssec_zone_sign_nsec3_flg_mkmap(ldns_dnssec_zone *zone,
                                                                         salt_length,
                                                                         salt);
                                /* always set bit 7 of the flags to zero, according to
-                                * rfc5155 section 11 */
+                                * rfc5155 section 11. The bits are counted from right to left,
+                                * so bit 7 in rfc5155 is bit 0 in ldns */
                                ldns_set_bit(ldns_rdf_data(ldns_rr_rdf(nsec3param, 1)), 0, 0);
                                result = ldns_dnssec_zone_add_rr(zone, nsec3param);
                                if (result != LDNS_STATUS_OK) {
diff --git a/util.c b/util.c
index f49a30d1e2853219cd1c8760853c966fd3d315cb..a7ab96080ce57278bf2275cefa0b680b00a87a62 100644 (file)
--- a/util.c
+++ b/util.c
@@ -107,6 +107,10 @@ ldns_get_bit_r(uint8_t bits[], size_t index)
 void
 ldns_set_bit(uint8_t *byte, int bit_nr, bool value)
 {
+       /*
+        * The bits are counted from right to left, so bit #0 is the
+        * right most bit.
+        */
        if (bit_nr >= 0 && bit_nr < 8) {
                if (value) {
                        *byte = *byte | (0x01 << bit_nr);