diff --git a/conf_schema.h b/conf_schema.h index 778eb156..7514c42c 100644 --- a/conf_schema.h +++ b/conf_schema.h @@ -210,6 +210,7 @@ ATOM(char, rhizome_rx, 0, cf_opt_char_boolean,, "") ATOM(char, rhizome_ads, 0, cf_opt_char_boolean,, "") ATOM(char, manifests, 0, cf_opt_char_boolean,, "") ATOM(char, vomp, 0, cf_opt_char_boolean,, "") +ATOM(char, trace, 0, cf_opt_char_boolean,, "") END_STRUCT STRUCT(log) diff --git a/fdqueue.c b/fdqueue.c index 76b4c17e..7d45ec15 100644 --- a/fdqueue.c +++ b/fdqueue.c @@ -87,7 +87,13 @@ int is_scheduled(const struct sched_ent *alarm) int _schedule(struct __sourceloc __whence, struct sched_ent *alarm) { if (config.debug.io) - DEBUGF("schedule(alarm=%s)", alloca_alarm_name(alarm)); + DEBUGF("schedule(alarm=%s) called from %s() %s:%d", + alloca_alarm_name(alarm), + __whence.function,__whence.file,__whence.line); + if (!alarm->stats) + WARNF("schedule() called from %s() %s:%d without supplying an alarm name", + alloca_alarm_name(alarm), + __whence.function,__whence.file,__whence.line); struct sched_ent *node = next_alarm, *last = NULL; diff --git a/log.h b/log.h index be0656e6..df6f859b 100644 --- a/log.h +++ b/log.h @@ -135,6 +135,7 @@ void set_log_implementation(void (*log_function)(int level, struct strbuf *buf)) #define DEBUGF_perror(F,...) LOGF_perror(LOG_LEVEL_DEBUG, F, ##__VA_ARGS__) #define DEBUG_perror(X) DEBUGF_perror("%s", (X)) #define D DEBUG("D") +#define T { if (config.debug.trace) DEBUG("T"); } #define DEBUG_argv(X,ARGC,ARGV) logArgv(LOG_LEVEL_DEBUG, __WHENCE__, (X), (ARGC), (ARGV)) #define dump(X,A,N) logDump(LOG_LEVEL_DEBUG, __WHENCE__, (X), (const unsigned char *)(A), (size_t)(N)) diff --git a/overlay_interface.c b/overlay_interface.c index 5951e914..564c5c4d 100644 --- a/overlay_interface.c +++ b/overlay_interface.c @@ -705,8 +705,9 @@ static void overlay_interface_poll(struct sched_ent *alarm) interface_read_file(interface); break; } - if (alarm->alarm!=-1) + if (alarm->alarm!=-1) { schedule(alarm); + } } if (alarm->poll.revents & POLLOUT){ diff --git a/overlay_link.c b/overlay_link.c index 8013bb43..e944d377 100644 --- a/overlay_link.c +++ b/overlay_link.c @@ -254,10 +254,16 @@ int overlay_send_probe(struct subscriber *peer, struct sockaddr_in addr, overlay if (interface->state!=INTERFACE_STATE_UP) return WHY("I can't send a probe if the interface is down."); - if (addr.sin_addr.s_addr==0) - return WHY("I can't send a probe to address 0.0.0.0"); - if (addr.sin_port==0) - return WHY("I can't send a probe to port 0"); + if (addr.sin_addr.s_addr==0) { + if (config.debug.overlayinterfaces) + WHY("I can't send a probe to address 0.0.0.0"); + return -1; + } + if (addr.sin_port==0) { + if (config.debug.overlayinterfaces) + WHY("I can't send a probe to port 0"); + return -1; + } // never send unicast probes over a stream interface if (interface->socket_type==SOCK_STREAM) diff --git a/rhizome_crypto.c b/rhizome_crypto.c index b0c705d6..fc95c9c5 100644 --- a/rhizome_crypto.c +++ b/rhizome_crypto.c @@ -17,6 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "crypto_sign_edwards25519sha512batch.h" +#include "nacl/src/crypto_sign_edwards25519sha512batch_ref/ge.h" + #include "serval.h" #include "conf.h" #include "str.h" @@ -351,9 +354,6 @@ int rhizome_verify_bundle_privatekey(rhizome_manifest *m, { IN(); -#include "crypto_sign_edwards25519sha512batch.h" -#include "nacl/src/crypto_sign_edwards25519sha512batch_ref/ge.h" - unsigned char h[64]; unsigned char pk[32]; ge_p3 A; @@ -664,4 +664,4 @@ int rhizome_derive_key(rhizome_manifest *m, rhizome_bk_t *bsk) bcopy(hash, m->payloadNonce, sizeof(m->payloadNonce)); return 0; -} \ No newline at end of file +}