+20 February 2019: Wouter
+ - Fix pythonmod include and sockaddr_un ifdefs for compile on
+ Windows, and for libunbound.
+
18 February 2019: Wouter
- Print query name with ip_ratelimit exceeded log lines.
- Spaces instead of tabs in that log message.
%module unbound
%{
#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
+ #endif
#include "libunbound/unbound.h"
%}
%inline %{
void ub_ctx_free_dbg (struct ub_ctx* c) {
- printf("******** UB_CTX free 0x%lX ************\n", (long unsigned int)c);
+ printf("******** UB_CTX free 0x%p ************\n", c);
ub_ctx_delete(c);
}
%inline %{
void ub_resolve_free_dbg (struct ub_result* r) {
- printf("******** UB_RESOLVE free 0x%lX ************\n", (long unsigned int)r);
+ printf("******** UB_RESOLVE free 0x%p ************\n", r);
ub_resolve_free(r);
}
%}
* called to perform operations on queries.
*/
#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+ #endif
+ #ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
+ #endif
+ #ifdef HAVE_NETDB_H
#include <netdb.h>
+ #endif
+ #ifdef HAVE_SYS_UN_H
#include <sys/un.h>
+ #endif
#include <stdarg.h>
#include "config.h"
#include "util/log.h"
switch (ss->ss_family) {
case AF_INET: return sizeof(struct sockaddr_in);
case AF_INET6: return sizeof(struct sockaddr_in6);
+#ifdef HAVE_SYS_UN_H
case AF_UNIX: return sizeof(struct sockaddr_un);
+#endif
default:
return 0;
}
return PyBytes_FromStringAndSize((const char *)raw, sizeof(*raw));
}
+#ifdef HAVE_SYS_UN_H
if (ss->ss_family == AF_UNIX) {
const struct sockaddr_un *sa = (struct sockaddr_un *)ss;
return PyBytes_FromString(sa->sun_path);
}
+#endif
return Py_None;
}
return;
pq = (struct pythonmod_qstate*)qstate->minfo[id];
- verbose(VERB_ALGO, "pythonmod: clear, id: %d, pq:%lX", id,
- (unsigned long int)pq);
+ verbose(VERB_ALGO, "pythonmod: clear, id: %d, pq:%p", id, pq);
if(pq != NULL)
{
PyGILState_STATE gil = PyGILState_Ensure();
size_t pythonmod_get_mem(struct module_env* env, int id)
{
struct pythonmod_env* pe = (struct pythonmod_env*)env->modinfo[id];
- verbose(VERB_ALGO, "pythonmod: get_mem, id: %d, pe:%lX", id,
- (unsigned long int)pe);
+ verbose(VERB_ALGO, "pythonmod: get_mem, id: %d, pe:%p", id, pe);
if(!pe)
return 0;
return sizeof(*pe);