summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-08 16:47:52 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-08 16:47:52 +0100
commite9ff4485fbe4a445968ed762f688c36516834826 (patch)
tree636d20a0f8be7e6a31ca5563faf665b260d9fd0b /src/peer.c
parent5268f248c91fb03f2de2a942a1eb1f171be96123 (diff)
downloadfastd-e9ff4485fbe4a445968ed762f688c36516834826.tar
fastd-e9ff4485fbe4a445968ed762f688c36516834826.zip
Fix some log messages
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/peer.c b/src/peer.c
index 0e53608..baebebb 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -30,8 +30,6 @@
#include "peer.h"
#include "task.h"
-#include <arpa/inet.h>
-
const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_buffer buffer) {
switch (ctx->conf->protocol) {
@@ -70,7 +68,7 @@ static inline void reset_peer(fastd_context *ctx, fastd_peer *peer) {
static inline void setup_peer(fastd_context *ctx, fastd_peer *peer) {
if (fastd_peer_is_temporary(peer)) {
- exit_fatal(ctx, "tried to reset temporary peer");
+ exit_fatal(ctx, "tried to setup temporary peer");
}
peer->address = peer->config->address;
@@ -82,24 +80,7 @@ static inline void setup_peer(fastd_context *ctx, fastd_peer *peer) {
}
void fastd_peer_reset(fastd_context *ctx, fastd_peer *peer) {
- if (is_debug(ctx)) {
- switch (peer->address.sa.sa_family) {
- case AF_UNSPEC:
- pr_debug(ctx, "resetting peer <floating>");
- break;
-
- case AF_INET:
- pr_debug(ctx, "resetting peer %I:%u", &peer->address.in.sin_addr, ntohs(peer->address.in.sin_port));
- break;
-
- case AF_INET6:
- pr_debug(ctx, "resetting peer [%lI]:%u", &peer->address.in6.sin6_addr, ntohs(peer->address.in6.sin6_port));
- break;
-
- default:
- exit_bug(ctx, "unsupported address family");
- }
- }
+ pr_debug(ctx, "resetting peer %P", peer);
reset_peer(ctx, peer);
setup_peer(ctx, peer);