summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/peer.c9
-rw-r--r--src/peer.h5
2 files changed, 7 insertions, 7 deletions
diff --git a/src/peer.c b/src/peer.c
index a661709..b1ae9b3 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -360,6 +360,11 @@ void fastd_peer_handle_resolve(fastd_peer_t *peer, fastd_remote_t *remote, size_
init_handshake(peer);
}
+/** Checks if a remote contains a hostname instead of a static IP address */
+static inline bool has_remote_hostname(const fastd_remote_t *remote) {
+ return remote->config->hostname;
+}
+
/** Initializes a peer */
static void setup_peer(fastd_peer_t *peer) {
fastd_peer_hashtable_remove(peer);
@@ -395,7 +400,7 @@ static void setup_peer(fastd_peer_t *peer) {
if (next_remote) {
next_remote->current_address = 0;
- if (fastd_remote_is_dynamic(next_remote)) {
+ if (has_remote_hostname(next_remote)) {
peer->state = STATE_RESOLVING;
fastd_resolve_peer(peer, next_remote);
fastd_peer_schedule_handshake_default(peer);
@@ -832,7 +837,7 @@ void fastd_peer_handle_handshake_queue(void) {
next_remote = fastd_peer_get_next_remote(peer);
next_remote->current_address = 0;
- if (fastd_remote_is_dynamic(next_remote))
+ if (has_remote_hostname(next_remote))
fastd_resolve_peer(peer, next_remote);
}
diff --git a/src/peer.h b/src/peer.h
index 1819f3c..c1f5be1 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -259,11 +259,6 @@ static inline const fastd_peer_group_t * fastd_peer_get_group(const fastd_peer_t
return conf.peer_group;
}
-/** Checks if a remote is dynamic (is contains a hostname instead of a static IP address) */
-static inline bool fastd_remote_is_dynamic(const fastd_remote_t *remote) {
- return remote->config->hostname;
-}
-
/** Signals that a valid packet was received from the peer */
static inline void fastd_peer_seen(fastd_peer_t *peer) {
peer->timeout = fastd_in_seconds(PEER_STALE_TIME);