]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Woo! First commit. Made lint happy. Now in lint checks mode.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Thu, 12 Jan 2006 11:08:22 +0000 (11:08 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Thu, 12 Jan 2006 11:08:22 +0000 (11:08 +0000)
Though a lot of spam warnings are ignored. Fixed header #defines
to not have _ at the start (not according to C99 says lint).
4 errors remain: rdata.c 64: memory leak (_data not freed).
rdata.c 94, 108: ntohs, ntohl undeclared. (lint is using posixlibs)
config.h: using inline statement is c++.

23 files changed:
ldns/buffer.h
ldns/common.h
ldns/dname.h
ldns/dns.h
ldns/dnssec.h
ldns/error.h
ldns/higher.h
ldns/host2str.h
ldns/host2wire.h
ldns/keys.h
ldns/net.h
ldns/packet.h
ldns/parse.h
ldns/rdata.h
ldns/resolver.h
ldns/rr.h
ldns/rr_functions.h
ldns/str2host.h
ldns/tsig.h
ldns/update.h
ldns/wire2host.h
ldns/zone.h
rdata.c

index b536939cd214089f869598326881d53d0f6b4f7d..70bbb43a4f6cfa71fc65d8143da83f5665fd93e9 100644 (file)
@@ -10,8 +10,8 @@
  * the java.nio.Buffer interface.
  */
 
-#ifndef _LDNS_BUFFER_H_
-#define _LDNS_BUFFER_H_
+#ifndef LDNS_BUFFER_H
+#define LDNS_BUFFER_H
 
 #include <assert.h>
 #include <stdarg.h>
@@ -502,4 +502,4 @@ void ldns_buffer_free(ldns_buffer *buffer);
  */
 void *ldns_buffer_export(ldns_buffer *buffer);
 
-#endif /* _LDNS_BUFFER_H_ */
+#endif /* LDNS_BUFFER_H */
index 7db02e080be3001fdcecf453f129d03b7ab4caac..3b1eacead2726f469116ee0a204461b8eb63ac6f 100644 (file)
@@ -10,8 +10,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_COMMON_H
-#define _LDNS_COMMON_H
+#ifndef LDNS_COMMON_H
+#define LDNS_COMMON_H
 
 #if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
 
@@ -47,4 +47,4 @@ typedef unsigned char bool;
 #define ATTR_UNUSED(x)  x
 #endif /* !HAVE_ATTR_UNUSED */
 
-#endif /* !_LDNS_COMMON_H */
+#endif /* LDNS_COMMON_H */
index 5962670fab1fe658a0ca05db563e96756256c9d5..b9ee354dfe849637ef58dc3c4d583a1b3894952b 100644 (file)
@@ -10,8 +10,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_DNAME_H
-#define _LDNS_DNAME_H
+#ifndef LDNS_DNAME_H
+#define LDNS_DNAME_H
 
 #include <ldns/common.h>
 #include <ldns/rdata.h>
@@ -123,4 +123,4 @@ bool ldns_dname_str_absolute(const char *dname_str);
  */
 ldns_rdf * ldns_dname_label(const ldns_rdf *rdf, uint8_t labelpos);
 
-#endif /* !_LDNS_DNAME_H */
+#endif /* LDNS_DNAME_H */
index 8d74cef93ae4da192a2fe55ec7305929f0b7643f..7c3de385bdc2b6e624c5ad090ecf4d8a0e7f73b9 100644 (file)
@@ -11,8 +11,8 @@
  * A bunch of defines that are used in the DNS.
  */
 
-#ifndef _LDNS_DNS_H_
-#define _LDNS_DNS_H_
+#ifndef LDNS_DNS_H
+#define LDNS_DNS_H
 
 #include <stdio.h>
 
@@ -64,4 +64,4 @@ extern ldns_lookup_table ldns_rcodes[];
 extern ldns_lookup_table ldns_opcodes[];
 extern ldns_lookup_table ldns_edns_flags[];
 
-#endif /* _LDNS_DNS_H_ */
+#endif /* LDNS_DNS_H */
index 3a54a3c01b45ff7e923772ab35e953593dd597d5..6f2ed1602d133fb5d37827c3108003fe2c8ee18d 100644 (file)
@@ -8,8 +8,8 @@
  * A bunch of defines that are used in the DNS
  */
 
-#ifndef _LDNS_DNSSEC_H_
-#define _LDNS_DNSSEC_H_
+#ifndef LDNS_DNSSEC_H
+#define LDNS_DNSSEC_H
 
 #ifdef HAVE_SSL
 #include <openssl/ssl.h>
@@ -118,7 +118,6 @@ ldns_rr_list *ldns_sign_public(ldns_rr_list *rrset, ldns_key_list *keys);
 ldns_rdf *ldns_sign_public_dsa(ldns_buffer *to_sign, DSA *key);
 ldns_rdf *ldns_sign_public_rsamd5(ldns_buffer *to_sign, RSA *key);
 ldns_rdf *ldns_sign_public_rsasha1(ldns_buffer *to_sign, RSA *key);
-ldns_rdf *ldns_sign_public_dsa(ldns_buffer *to_sign, DSA *key);
 #endif /* HAVE_SSL */
 
 /**
@@ -154,4 +153,4 @@ ldns_zone *ldns_zone_sign(ldns_zone *zone, ldns_key_list *key_list);
  */
 ldns_status ldns_init_random(FILE *fd, uint16_t bytes);
 
-#endif /* _LDNS_DNSSEC_H_ */
+#endif /* LDNS_DNSSEC_H */
index a47b043bb75cb61779fae4d15f4a2301f37d5c72..1b66baf745565859bdc76bd5f20150cb28190c54 100644 (file)
@@ -10,8 +10,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_ERROR_H
-#define _LDNS_ERROR_H
+#ifndef LDNS_ERROR_H
+#define LDNS_ERROR_H
 
 #include <ldns/util.h>
 
@@ -73,4 +73,4 @@ extern ldns_lookup_table ldns_error_str[];
  */
 const char *ldns_get_errorstr_by_id(ldns_status err);
 
-#endif /* _LDNS_ERROR_H */
+#endif /* LDNS_ERROR_H */
index 69ff3fcb2d6b31f14e66c2abd093c354fa217a57..09decc9543d862b1d820ea369edd6e8fdfc72391 100644 (file)
@@ -11,8 +11,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_HIGHER_H
-#define _LDNS_HIGHER_H
+#ifndef LDNS_HIGHER_H
+#define LDNS_HIGHER_H
 
 #include <ldns/resolver.h>
 #include <ldns/rdata.h>
@@ -111,4 +111,4 @@ ldns_status ldns_update_send_simple_addr(const char *fqdn, const char *zone,
  */
 void ldns_print_rr_rdf(FILE *fp, ldns_rr *r, int rdfnum, ...);
 
-#endif /* _LDNS_HIGHER_H */
+#endif /* LDNS_HIGHER_H */
index b9968aa6cde3bdbe15f655b4076262c51d6b4bf1..f4d68b544c365d941a08b4604d52a718a141f863 100644 (file)
@@ -8,8 +8,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_HOST2STR_H
-#define _LDNS_HOST2STR_H
+#ifndef LDNS_HOST2STR_H
+#define LDNS_HOST2STR_H
 
 #include <ldns/common.h>
 #include <ldns/error.h>
@@ -378,4 +378,4 @@ void ldns_zone_print(FILE *output, ldns_zone *z);
 ldns_status ldns_rdf2buffer_str_dname(ldns_buffer *output, ldns_rdf *dname);
 
 
-#endif
+#endif /* LDNS_HOST2STR_H */
index f2d6025d00db15b5006399c0a7628009f5e9423e..5c8401fada186eea6026a4bc89cdcda707d240e7 100644 (file)
@@ -8,8 +8,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_HOST2WIRE_H
-#define _LDNS_HOST2WIRE_H
+#ifndef LDNS_HOST2WIRE_H
+#define LDNS_HOST2WIRE_H
 
 #include <ldns/common.h>
 #include <ldns/error.h>
@@ -111,4 +111,4 @@ ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int, size_t *size);
  */
 ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t *size);
 
-#endif
+#endif /* LDNS_HOST2WIRE_H */
index 8a34b5f9785815fc3233ef6ab95d0fc7925e6d5a..7ec2f4dafcae2969c620a63af4933278c4088a6b 100644 (file)
@@ -11,8 +11,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_KEYS_H
-#define _LDNS_KEYS_H
+#ifndef LDNS_KEYS_H
+#define LDNS_KEYS_H
 
 #ifdef HAVE_SSL
 #include <openssl/ssl.h>
@@ -273,4 +273,4 @@ void ldns_key_deep_free(ldns_key *key);
  */
 void ldns_key_list_free(ldns_key_list *key_list);
 
-#endif /* _LDNS_KEYS_H */
+#endif /* LDNS_KEYS_H */
index 6e0335e04a6c48a2f2b51e44de2b723de3d92aef..0b1007ebf526f3115d2138c2d0149a95557a2abf 100644 (file)
@@ -10,8 +10,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_NET_H
-#define _LDNS_NET_H
+#ifndef LDNS_NET_H
+#define LDNS_NET_H
 
 #include <ldns/packet.h>
 #include <ldns/buffer.h>
@@ -180,4 +180,4 @@ ldns_rdf * ldns_sockaddr_storage2rdf(struct sockaddr_storage *sock, uint16_t *po
  */
 ldns_status ldns_axfr_start(ldns_resolver *resolver, ldns_rdf *domain, ldns_rr_class c);
 
-#endif  /* !_LDNS_NET_H */
+#endif  /* LDNS_NET_H */
index c4661cf762e16a5bb040f9ea52b4c2c09aa88e81..4f1f015ad52f76396a697b3dd4d1feff0b20cc0c 100644 (file)
@@ -10,8 +10,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_PACKET_H
-#define _LDNS_PACKET_H
+#ifndef LDNS_PACKET_H
+#define LDNS_PACKET_H
 
 #define LDNS_MAX_PACKETLEN         65535
 
@@ -326,4 +326,4 @@ ldns_rr * ldns_pkt_set_rr(ldns_pkt *p, ldns_rr *rr, uint16_t n);
 bool ldns_pkt_insert_rr(ldns_pkt *p, ldns_rr *rr, uint16_t n);
        
 
-#endif  /* !_LDNS_PACKET_H */
+#endif  /* LDNS_PACKET_H */
index 87dd2e3ba991c299c2d28526ff24c1454b692acd..514fb5a6aacdfb1b790bdb36b85f6c2bc3aa77f4 100644 (file)
@@ -7,8 +7,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_PARSE_H_
-#define _LDNS_PARSE_H_
+#ifndef LDNS_PARSE_H
+#define LDNS_PARSE_H
 
 #include <ldns/common.h>
 #include <ldns/buffer.h>
@@ -157,4 +157,4 @@ void ldns_fskipcs(FILE *fp, const char *s);
  */
 void ldns_fskipcs_l(FILE *fp, const char *s, int *line_nr);
 
-#endif /* _LDNS_PARSE_H */
+#endif /* LDNS_PARSE_H */
index 83fac09a7480f2d2c649e09504802167431e4b2c..26e6d956d2eff3d3c48945099f8a5e182d600cc1 100644 (file)
@@ -11,8 +11,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_RDATA_H
-#define _LDNS_RDATA_H
+#ifndef LDNS_RDATA_H
+#define LDNS_RDATA_H
 
 #include <ldns/common.h>
 #include <ldns/error.h>
@@ -344,4 +344,4 @@ ldns_rdf    *ldns_rdf_clone(const ldns_rdf *rd);
  */
 int            ldns_rdf_compare(const ldns_rdf *rd1, const ldns_rdf *rd2);
 
-#endif /* !_LDNS_RDATA_H */
+#endif /* LDNS_RDATA_H */
index 12999cab8a49baa4f204d1cb47f5ed8556dd5148..2a6dd5346321a908702f6b4e7fbf2a25c580490a 100644 (file)
@@ -10,8 +10,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_RESOLVER_H
-#define _LDNS_RESOLVER_H
+#ifndef LDNS_RESOLVER_H
+#define LDNS_RESOLVER_H
 
 #include <ldns/error.h>
 #include <ldns/common.h>
@@ -476,4 +476,4 @@ void ldns_resolver_nameservers_randomize(ldns_resolver *r);
  */
 ldns_resolver * ldns_update_resolver_new(const char *fqdn, const char *zone, ldns_rr_class clas, ldns_tsig_credentials *tsig_cred, ldns_rdf **zone_rdf);
 
-#endif  /* !_LDNS_RESOLVER_H */
+#endif  /* LDNS_RESOLVER_H */
index 8d571927a93ac11cbd5a20617a5f41b94b0db498..dcdfbaa5893b5f54ba0970268d008620a2ff69f3 100644 (file)
--- a/ldns/rr.h
+++ b/ldns/rr.h
@@ -8,8 +8,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_RR_H
-#define _LDNS_RR_H
+#ifndef LDNS_RR_H
+#define LDNS_RR_H
 
 #include <ldns/common.h>
 #include <ldns/rdata.h>
@@ -679,4 +679,4 @@ ldns_rr_type    ldns_rdf2rr_type(const ldns_rdf *rd);
 /* TODO document or delete it */
 bool ldns_rr_list_insert_rr(ldns_rr_list *rr_list, ldns_rr *r, size_t count);
 
-#endif /* _LDNS_RR_H */
+#endif /* LDNS_RR_H */
index 51aa6bb8ea7a94404ae69fc1e85979890760b3a6..63d2c5c7135bfa11099728eeaab38e5cb028a8be 100644 (file)
@@ -10,8 +10,8 @@
  * 
  * See the file LICENSE for the license
  */
-#ifndef _LDNS_RR_FUNCTIONS_H
-#define _LDNS_RR_FUNCTIONS_H
+#ifndef LDNS_RR_FUNCTIONS_H
+#define LDNS_RR_FUNCTIONS_H
 
 
 /* set rdf's at a specific offset
@@ -238,4 +238,4 @@ bool ldns_rr_dnskey_set_key(ldns_rr *r, ldns_rdf *f);
  */
 uint16_t ldns_rr_dnskey_key_size(ldns_rr *key);
 
-#endif /* _LDNS_RR_FUNCTIONS_H */
+#endif /* LDNS_RR_FUNCTIONS_H */
index d72395baf22f87ab72ddbfd3622b65868672dd67..7cf9ce4c5c47de5ca77479796cba7a2e34914ef9 100644 (file)
@@ -8,8 +8,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_2HOST_H
-#define _LDNS_2HOST_H
+#ifndef LDNS_2HOST_H
+#define LDNS_2HOST_H
 
 #include <ldns/common.h>
 #include <ldns/error.h>
@@ -210,4 +210,4 @@ ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str);
  */
 ldns_status ldns_str2rdf_dname(ldns_rdf **rd, const char *str);
 
-#endif /* _LDNS_2HOST_H */
+#endif /* LDNS_2HOST_H */
index 7ff5780cecaa860a4ac8e201db8f42b73d8da3db..4f42242e26b90e56ca7536f7c1bbf997bc691402 100644 (file)
@@ -6,10 +6,10 @@
  * See LICENSE for the license.
  */
 
-#ifndef _LDNS_TSIG_H_
-#define _LDNS_TSIG_H_
+#ifndef LDNS_TSIG_H
+#define LDNS_TSIG_H
 
-typedef struct _ldns_tsig_credentials 
+typedef struct ldns_tsig_credentials_struct
 {
     char *algorithm;
     char *keyname;
@@ -43,4 +43,4 @@ bool ldns_pkt_tsig_verify(ldns_pkt *pkt, uint8_t *wire, size_t wire_size, const
  */
 ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name, const char *key_data, uint16_t fudge, const char *algorithm_name, ldns_rdf *query_mac);
 
-#endif /* _LDNS_TSIG_H_ */
+#endif /* LDNS_TSIG_H */
index c2e4a2d10d0592ab0c05a0006e3cf84f571f5514..c9e98fb889eeddb14e2fa907a08b3c780bb3b7fd 100644 (file)
@@ -8,8 +8,8 @@
  * See LICENSE for the license.
  */
 
-#ifndef _LDNS_UPDATE_H
-#define _LDNS_UPDATE_H
+#ifndef LDNS_UPDATE_H
+#define LDNS_UPDATE_H
 
 #include <ldns/resolver.h>
 
@@ -48,4 +48,4 @@ ldns_status ldns_update_soa_mname(ldns_rdf *zone, ldns_resolver *r, ldns_rr_clas
 ldns_status ldns_update_soa_zone_mname(const char *fqdn, ldns_resolver *r, ldns_rr_class class, ldns_rdf **zone_rdf, ldns_rdf **mname_rdf);
 
 
-#endif  /* !_LDNS_UPDATE_H */
+#endif  /* LDNS_UPDATE_H */
index e8f6743e1b2713fcef6a1d2942978449407baa6f..e602eff8c826c5debd70d14916c5d5faa929d0bd 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 
-#ifndef _LDNS_WIRE2HOST_H
-#define _LDNS_WIRE2HOST_H
+#ifndef LDNS_WIRE2HOST_H
+#define LDNS_WIRE2HOST_H
 
 #include <ldns/rdata.h>
 #include <ldns/common.h>
@@ -176,4 +176,4 @@ ldns_status ldns_wire2rdf(ldns_rr *rr, const uint8_t *wire, size_t max, size_t *
  */
 ldns_status ldns_wire2rr(ldns_rr **rr, const uint8_t *wire, size_t max, size_t *pos, ldns_pkt_section section);
 
-#endif /* _LDNS_WIRE2HOST_H */
+#endif /* LDNS_WIRE2HOST_H */
index a4dc5fc82a4da8a3b074a7a1b0febfa4a5ef1342..2a3986ea7907072eb6d9a1207f48ea6ffd46f8f8 100644 (file)
@@ -13,8 +13,8 @@
  * See the file LICENSE for the license
  */
 
-#ifndef _LDNS_ZONE_H
-#define _LDNS_ZONE_H
+#ifndef LDNS_ZONE_H
+#define LDNS_ZONE_H
 
 #include <ldns/common.h>
 #include <ldns/rdata.h>
diff --git a/rdata.c b/rdata.c
index 4cf24f723542886d48bfb685f483c128eda228df..307da62d7dabb17e04444b7a6a77b3eb388bb80a 100644 (file)
--- a/rdata.c
+++ b/rdata.c
@@ -43,25 +43,25 @@ ldns_rdf_data(const ldns_rdf *rd)
 
 /* write */
 void
-ldns_rdf_set_size(ldns_rdf *rd, size_t s)
+ldns_rdf_set_size(ldns_rdf *rd, size_t size)
 {
        assert(rd != NULL);
-       rd->_size = s;
+       rd->_size = size;
 }
 
 void
-ldns_rdf_set_type(ldns_rdf *rd, ldns_rdf_type t)
+ldns_rdf_set_type(ldns_rdf *rd, ldns_rdf_type type)
 {
        assert(rd != NULL);
-       rd->_type = t;
+       rd->_type = type;
 }
 
 void
-ldns_rdf_set_data(ldns_rdf *rd, void *d)
+ldns_rdf_set_data(ldns_rdf *rd, void *data)
 {
        /* only copy the pointer */
        assert(rd != NULL);
-       rd->_data = d;
+       rd->_data = data;
 }
 
 /* for types that allow it, return
@@ -154,16 +154,16 @@ ldns_native2rdf_int16_data(size_t size, uint8_t *data)
 }
 
 ldns_rdf *
-ldns_rdf_new(ldns_rdf_type t, size_t s, void *d)
+ldns_rdf_new(ldns_rdf_type type, size_t size, void *data)
 {
        ldns_rdf *rd;
        rd = LDNS_MALLOC(ldns_rdf);
        if (!rd) {
                return NULL;
        }
-       ldns_rdf_set_size(rd, s);
-       ldns_rdf_set_type(rd, t);
-       ldns_rdf_set_data(rd, d);
+       ldns_rdf_set_size(rd, size);
+       ldns_rdf_set_type(rd, type);
+       ldns_rdf_set_data(rd, data);
        return rd;
 }
 
@@ -187,13 +187,13 @@ ldns_rdf_new_frm_data(ldns_rdf_type type, size_t size, const void *data)
 }
 
 ldns_rdf *
-ldns_rdf_clone(const ldns_rdf *r)
+ldns_rdf_clone(const ldns_rdf *rd)
 {
-       assert(r != NULL);
+       assert(rd != NULL);
        return (ldns_rdf_new_frm_data(
-                               ldns_rdf_get_type(r),
-                               ldns_rdf_size(r), 
-                               ldns_rdf_data(r)));
+                               ldns_rdf_get_type(rd),
+                               ldns_rdf_size(rd), 
+                               ldns_rdf_data(rd)));
 }
 
 void
@@ -218,7 +218,7 @@ ldns_rdf_free(ldns_rdf *rd)
 ldns_rdf *
 ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str)
 {
-       ldns_rdf *rdf;
+       ldns_rdf *rdf=0;
        ldns_status status;
 
        switch (type) {
@@ -334,7 +334,7 @@ ldns_rdf_new_frm_fp_l(ldns_rdf_type type, FILE *fp, int *line_nr)
 }
 
 ldns_rdf *
-ldns_rdf_address_reverse(ldns_rdf *rdf)
+ldns_rdf_address_reverse(ldns_rdf *rd)
 {
        uint8_t buf_4[LDNS_IP4ADDRLEN];
        uint8_t buf_6[LDNS_IP6ADDRLEN * 2];
@@ -349,21 +349,21 @@ ldns_rdf_address_reverse(ldns_rdf *rdf)
        char *char_dname;
        int nbit;
 
-       if (ldns_rdf_get_type(rdf) != LDNS_RDF_TYPE_A &&
-                       ldns_rdf_get_type(rdf) != LDNS_RDF_TYPE_AAAA) {
+       if (ldns_rdf_get_type(rd) != LDNS_RDF_TYPE_A &&
+                       ldns_rdf_get_type(rd) != LDNS_RDF_TYPE_AAAA) {
                return NULL;
        }
 
        in_addr = NULL;
        ret_dname = NULL;
 
-       switch(ldns_rdf_get_type(rdf)) {
+       switch(ldns_rdf_get_type(rd)) {
                case LDNS_RDF_TYPE_A:
                        /* the length of the buffer is 4 */
-                       buf_4[3] = ldns_rdf_data(rdf)[0];
-                       buf_4[2] = ldns_rdf_data(rdf)[1];
-                       buf_4[1] = ldns_rdf_data(rdf)[2];
-                       buf_4[0] = ldns_rdf_data(rdf)[3];
+                       buf_4[3] = ldns_rdf_data(rd)[0];
+                       buf_4[2] = ldns_rdf_data(rd)[1];
+                       buf_4[1] = ldns_rdf_data(rd)[2];
+                       buf_4[0] = ldns_rdf_data(rd)[3];
                        in_addr = ldns_dname_new_frm_str("in-addr.arpa.");
                        if (!in_addr) {
                                return NULL;
@@ -397,7 +397,7 @@ ldns_rdf_address_reverse(ldns_rdf *rdf)
                                /* calculate nibble */
                                nnibble = ( ((unsigned int) nbit) & 0x04) >> 2;
                                /* extract nibble */
-                               nibble = (ldns_rdf_data(rdf)[octet] & ( 0xf << (4 * (1 - nnibble)) ) ) >> ( 4 * (1 - nnibble));
+                               nibble = (ldns_rdf_data(rd)[octet] & ( 0xf << (4 * (1 - nnibble)) ) ) >> ( 4 * (1 - nnibble));
                                buf_6[(LDNS_IP6ADDRLEN * 2 - 1) -
                                        (octet * 2 + nnibble)] = (uint8_t)ldns_int_to_hexdigit((int)nibble);
                        }