From: Wouter Wijngaards Date: Wed, 7 Jan 2015 09:29:59 +0000 (+0000) Subject: - Fix warnings in pythonmod changes. X-Git-Tag: release-1.5.2rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d978957ad926604fb9aca1721faec5dacf48f274;p=thirdparty%2Funbound.git - Fix warnings in pythonmod changes. git-svn-id: file:///svn/unbound/trunk@3311 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index cf5678818..fab6058a3 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +7 January 2015: Wouter + - Fix warnings in pythonmod changes. + 6 January 2015: Wouter - iana portlist update. - patch for remote control over local sockets, from Dag-Erling diff --git a/pythonmod/interface.i b/pythonmod/interface.i index 19ded4b33..b2dd08904 100644 --- a/pythonmod/interface.i +++ b/pythonmod/interface.i @@ -28,6 +28,7 @@ #include "services/mesh.h" #include "iterator/iter_delegpt.h" #include "iterator/iter_hints.h" + #include "iterator/iter_utils.h" #include "ldns/wire2str.h" #include "ldns/str2wire.h" #include "ldns/pkthdr.h" @@ -980,7 +981,7 @@ int set_return_msg(struct module_qstate* qstate, /* Functions which we will need to lookup delegations */ struct delegpt* dns_cache_find_delegation(struct module_env* env, - char* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, + uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional* region, struct dns_msg** msg, uint32_t timenow); int iter_dp_is_useless(struct query_info* qinfo, uint16_t qflags, struct delegpt* dp); @@ -1004,22 +1005,22 @@ struct delegpt* find_delegation(struct module_qstate* qstate, char *nm, size_t n uint32_t timenow = *qstate->env->now; regional_free_all(region); - qinfo.qname = nm; + qinfo.qname = (uint8_t*)nm; qinfo.qname_len = nmlen; qinfo.qtype = LDNS_RR_TYPE_A; qinfo.qclass = LDNS_RR_CLASS_IN; while(1) { - dp = dns_cache_find_delegation(qstate->env, nm, nmlen, qinfo.qtype, qinfo.qclass, region, &msg, timenow); + dp = dns_cache_find_delegation(qstate->env, (uint8_t*)nm, nmlen, qinfo.qtype, qinfo.qclass, region, &msg, timenow); if(!dp) return NULL; if(iter_dp_is_useless(&qinfo, BIT_RD, dp)) { - if (dname_is_root(nm)) + if (dname_is_root((uint8_t*)nm)) return NULL; - nm = dp->name; + nm = (char*)dp->name; nmlen = dp->namelen; dname_remove_label((uint8_t**)&nm, &nmlen); - dname_str(nm, b); + dname_str((uint8_t*)nm, b); continue; } stub = hints_lookup_stub(qstate->env->hints, qinfo.qname, qinfo.qclass, dp); diff --git a/pythonmod/pythonmod_utils.h b/pythonmod/pythonmod_utils.h index a901f391a..768eb46de 100644 --- a/pythonmod/pythonmod_utils.h +++ b/pythonmod/pythonmod_utils.h @@ -42,6 +42,7 @@ #define PYTHONMOD_UTILS_H #include "util/module.h" +struct delegpt_addr; /** * Store the reply_info and query_info pair in message cache (qstate->msg_cache) @@ -86,4 +87,7 @@ int createResponse(struct module_qstate* qstate, sldns_buffer* pkt); */ void reply_addr2str(struct comm_reply* reply, char* dest, int maxlen); +/* Convert target->addr to string */ +void delegpt_addr_addr2str(struct delegpt_addr* target, char *dest, int maxlen); + #endif /* PYTHONMOD_UTILS_H */