summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-18 21:33:06 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-18 21:33:06 +0200
commitc251df4a17e45460fa20822df596e507ef1b1629 (patch)
treeb4c17a93f247feb3a9f435522783ea944a84a636 /src/peer.c
parent02c72f46bd3990a9835eb82c72da5fed37107470 (diff)
downloadfastd-c251df4a17e45460fa20822df596e507ef1b1629.tar
fastd-c251df4a17e45460fa20822df596e507ef1b1629.zip
peer: remove fastd_remote_is_dynamic()
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c9
1 files changed, 7 insertions, 2 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);
}