summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-06-06 13:14:54 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-06-06 13:14:54 +0200
commit7297dd73d5bfa05f829bf44cd8480627d5b387f8 (patch)
tree987645be361c5abec09b749a47b6863ffb501228
parentb3d678c5f2f2f6208f37780090427b6c47e446e4 (diff)
downloadfastd-7297dd73d5bfa05f829bf44cd8480627d5b387f8.tar
fastd-7297dd73d5bfa05f829bf44cd8480627d5b387f8.zip
Improve some log levels
-rw-r--r--src/config.c6
-rw-r--r--src/fastd.c8
-rw-r--r--src/peer.c6
-rw-r--r--src/protocol_ec25519_fhmqvc.c12
-rw-r--r--src/resolve.c8
5 files changed, 20 insertions, 20 deletions
diff --git a/src/config.c b/src/config.c
index f10c058..d017325 100644
--- a/src/config.c
+++ b/src/config.c
@@ -722,7 +722,7 @@ static void reconfigure_handle_old_peers(fastd_context *ctx, fastd_peer_config *
if (((*peer)->config_source_dir == (*new_peer)->config_source_dir) && strequal((*peer)->name, (*new_peer)->name)) {
if (fastd_peer_config_equal(*peer, *new_peer)) {
- pr_debug(ctx, "peer `%s' unchanged", (*peer)->name);
+ pr_verbose(ctx, "peer `%s' unchanged", (*peer)->name);
fastd_peer_config *free_peer = *new_peer;
*new_peer = *new_next;
@@ -730,7 +730,7 @@ static void reconfigure_handle_old_peers(fastd_context *ctx, fastd_peer_config *
peer = NULL;
}
else {
- pr_debug(ctx, "peer `%s' changed, resetting", (*peer)->name);
+ pr_verbose(ctx, "peer `%s' changed, resetting", (*peer)->name);
new_peer = NULL;
}
@@ -740,7 +740,7 @@ static void reconfigure_handle_old_peers(fastd_context *ctx, fastd_peer_config *
/* no new peer was found, or the old one has changed */
if (peer && (!new_peer || !*new_peer)) {
- pr_debug(ctx, "removing peer `%s'", (*peer)->name);
+ pr_verbose(ctx, "removing peer `%s'", (*peer)->name);
fastd_peer_config *free_peer = *peer;
*peer = *next;
diff --git a/src/fastd.c b/src/fastd.c
index 9e5e528..afa36eb 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -134,7 +134,7 @@ static void init_sockets(fastd_context *ctx) {
pr_warn(ctx, "there are IPv6 peers defined, but bind is explicitly set to IPv4");
if (addr_in.sin_family == AF_INET) {
- pr_debug(ctx, "Initializing IPv4 socket...");
+ pr_debug(ctx, "initializing IPv4 socket...");
if ((ctx->sockfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
exit_errno(ctx, "socket");
@@ -149,7 +149,7 @@ static void init_sockets(fastd_context *ctx) {
}
if (addr_in6.sin6_family == AF_INET6) {
- pr_debug(ctx, "Initializing IPv6 socket...");
+ pr_debug(ctx, "initializing IPv6 socket...");
if ((ctx->sock6fd = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
if (ctx->sockfd >= 0)
@@ -176,10 +176,10 @@ static void init_sockets(fastd_context *ctx) {
static void init_tuntap(fastd_context *ctx) {
struct ifreq ifr;
- pr_debug(ctx, "Initializing tun/tap device...");
+ pr_debug(ctx, "initializing tun/tap device...");
if ((ctx->tunfd = open("/dev/net/tun", O_RDWR)) < 0)
- exit_errno(ctx, "Could not open tun/tap device file");
+ exit_errno(ctx, "could not open tun/tap device file");
memset(&ifr, 0, sizeof(ifr));
diff --git a/src/peer.c b/src/peer.c
index db1f61a..23cb170 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -328,7 +328,7 @@ fastd_peer* fastd_peer_add(fastd_context *ctx, fastd_peer_config *peer_conf) {
peer->config = peer_conf;
setup_peer(ctx, peer);
- pr_debug(ctx, "adding peer %P", peer);
+ pr_verbose(ctx, "adding peer %P", peer);
return peer;
}
@@ -337,7 +337,7 @@ void fastd_peer_set_established(fastd_context *ctx, fastd_peer *peer) {
if (!peer->established) {
peer->established = true;
on_establish(ctx, peer);
- pr_info(ctx, "Connection with %P established.", peer);
+ pr_info(ctx, "connection with %P established.", peer);
}
}
@@ -428,7 +428,7 @@ void fastd_peer_eth_addr_add(fastd_context *ctx, fastd_peer *peer, const fastd_e
ctx->eth_addr[min] = (fastd_peer_eth_addr){ *addr, peer, ctx->now };
- pr_debug(ctx, "Learned new MAC address %E on peer %P", addr, peer);
+ pr_debug(ctx, "learned new MAC address %E on peer %P", addr, peer);
}
void fastd_peer_eth_addr_cleanup(fastd_context *ctx) {
diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c
index e53f4e8..1772f4b 100644
--- a/src/protocol_ec25519_fhmqvc.c
+++ b/src/protocol_ec25519_fhmqvc.c
@@ -144,7 +144,7 @@ static inline void check_session_refresh(fastd_context *ctx, fastd_peer *peer) {
protocol_session *session = &peer->protocol_state->session;
if (!session->refreshing && ctx->conf->method->session_is_initiator(ctx, session->method_state) && ctx->conf->method->session_want_refresh(ctx, session->method_state)) {
- pr_debug(ctx, "refreshing session with %P", peer);
+ pr_verbose(ctx, "refreshing session with %P", peer);
session->handshakes_cleaned = true;
session->refreshing = true;
fastd_task_schedule_handshake(ctx, peer, 0);
@@ -183,7 +183,7 @@ static void protocol_peer_configure(fastd_context *ctx, fastd_peer_config *peer_
}
if (memcmp(key.p, ctx->conf->protocol_config->public_key.p, 32) == 0) {
- pr_verbose(ctx, "found own key as `%s', ignoring peer", peer_conf->name);
+ pr_debug(ctx, "found own key as `%s', ignoring peer", peer_conf->name);
peer_conf->enabled = false;
return;
}
@@ -545,7 +545,7 @@ static void protocol_handshake_handle(fastd_context *ctx, const fastd_peer_addre
fastd_peer *peer = get_peer(ctx, peer_conf);
if (backoff(ctx, peer)) {
- pr_verbose(ctx, "received repeated handshakes from %P[%I], ignoring", peer, address);
+ pr_debug(ctx, "received repeated handshakes from %P[%I], ignoring", peer, address);
return;
}
@@ -580,7 +580,7 @@ static void protocol_handshake_handle(fastd_context *ctx, const fastd_peer_addre
if (handshake->records[RECORD_VERSION_NAME].data)
peer_version_name = strndup(handshake->records[RECORD_VERSION_NAME].data, handshake->records[RECORD_VERSION_NAME].length);
- pr_debug(ctx, "received handshake from %P[%I] using fastd %s", peer, address, peer_version_name);
+ pr_verbose(ctx, "received handshake from %P[%I] using fastd %s", peer, address, peer_version_name);
free(peer_version_name);
respond_handshake(ctx, address, peer, &ctx->protocol_state->handshake_key, handshake->records[RECORD_SENDER_HANDSHAKE_KEY].data, handshake);
@@ -601,7 +601,7 @@ static void protocol_handshake_handle(fastd_context *ctx, const fastd_peer_addre
if (handshake->records[RECORD_VERSION_NAME].data)
peer_version_name = strndup(handshake->records[RECORD_VERSION_NAME].data, handshake->records[RECORD_VERSION_NAME].length);
- pr_debug(ctx, "received handshake response from %P[%I] using fastd %s", peer, address, peer_version_name);
+ pr_verbose(ctx, "received handshake response from %P[%I] using fastd %s", peer, address, peer_version_name);
free(peer_version_name);
finish_handshake(ctx, address, peer, handshake_key, handshake->records[RECORD_SENDER_HANDSHAKE_KEY].data, handshake);
@@ -672,7 +672,7 @@ static void protocol_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buf
}
if (!ok) {
- pr_debug(ctx, "verification failed for packet received from %P", peer);
+ pr_verbose(ctx, "verification failed for packet received from %P", peer);
goto fail;
}
diff --git a/src/resolve.c b/src/resolve.c
index 20355d7..2a913d8 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -62,11 +62,11 @@ static void* resolve_peer(void *varg) {
gai_ret = getaddrinfo(arg->hostname, portstr, &hints, &res);
if (gai_ret || !res) {
- pr_debug(arg->ctx, "Resolving host `%s' failed: %s", arg->hostname, gai_strerror(gai_ret));
+ pr_verbose(arg->ctx, "resolving host `%s' failed: %s", arg->hostname, gai_strerror(gai_ret));
error = true;
}
else if (res->ai_addrlen > sizeof(fastd_peer_address) || (res->ai_addr->sa_family != AF_INET && res->ai_addr->sa_family != AF_INET6)) {
- pr_warn(arg->ctx, "Resolving host `%s': unsupported address returned", arg->hostname);
+ pr_warn(arg->ctx, "resolving host `%s': unsupported address returned", arg->hostname);
error = true;
}
@@ -77,7 +77,7 @@ static void* resolve_peer(void *varg) {
ret.constraints = arg->constraints;
if (!error) {
- pr_debug(arg->ctx, "Resolved host `%s' successfully", arg->hostname);
+ pr_verbose(arg->ctx, "resolved host `%s' successfully", arg->hostname);
memcpy(&ret.addr, res->ai_addr, res->ai_addrlen);
}
else {
@@ -94,7 +94,7 @@ static void* resolve_peer(void *varg) {
}
void fastd_resolve_peer(fastd_context *ctx, const fastd_peer_config *peer) {
- pr_debug(ctx, "Resolving host `%s' for peer `%s'...", peer->hostname, peer->name);
+ pr_verbose(ctx, "resolving host `%s' for peer `%s'...", peer->hostname, peer->name);
resolv_arg *arg = malloc(sizeof(resolv_arg));