From 5268f248c91fb03f2de2a942a1eb1f171be96123 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Mar 2012 01:47:34 +0100 Subject: New and improved handshake --- src/peer.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/peer.h') diff --git a/src/peer.h b/src/peer.h index 8a1ca7e..4668243 100644 --- a/src/peer.h +++ b/src/peer.h @@ -81,15 +81,15 @@ static inline bool fastd_peer_config_is_floating(const fastd_peer_config *config return (config->address.sa.sa_family == AF_UNSPEC); } -static inline bool fastd_peer_is_floating(fastd_peer *peer) { +static inline bool fastd_peer_is_floating(const fastd_peer *peer) { return (peer->config && fastd_peer_config_is_floating(peer->config)); } -static inline bool fastd_peer_is_temporary(fastd_peer *peer) { +static inline bool fastd_peer_is_temporary(const fastd_peer *peer) { return (peer->state == STATE_TEMP || peer->state == STATE_TEMP_ESTABLISHED); } -static inline bool fastd_peer_is_established(fastd_peer *peer) { +static inline bool fastd_peer_is_established(const fastd_peer *peer) { return (peer->state == STATE_ESTABLISHED || peer->state == STATE_TEMP_ESTABLISHED); } @@ -105,7 +105,10 @@ static inline void fastd_peer_set_established(fastd_context *ctx, fastd_peer *pe default: pr_warn(ctx, "tried to set an already established connection to established"); + return; } + + pr_info(ctx, "Connection with %P established.", peer); } static inline bool fastd_eth_addr_is_unicast(const fastd_eth_addr *addr) { -- cgit v1.2.3