summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-23 20:52:48 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-23 20:52:48 +0200
commitce4645aef8b57f5ac8f1697d6396ce4761aed843 (patch)
tree391154ce4d60047f4507a61588d81ded7aa155c6 /src/fastd.c
parent945cc762afe999bdc9b30fa2818f64e7a5ae2db6 (diff)
downloadfastd-ce4645aef8b57f5ac8f1697d6396ce4761aed843.tar
fastd-ce4645aef8b57f5ac8f1697d6396ce4761aed843.zip
Don't trigger a resolve when a packet from an unknown peer is received
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/fastd.c b/src/fastd.c
index b78fa34..e35584a 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -959,9 +959,7 @@ static inline void handle_socket_receive_known(fastd_context_t *ctx, fastd_socke
}
static inline bool is_unknown_peer_valid(fastd_context_t *ctx, const fastd_peer_address_t *remote_addr) {
- return ctx->conf->n_floating || ctx->conf->n_dynamic || ctx->conf->on_verify ||
- (remote_addr->sa.sa_family == AF_INET && ctx->conf->n_dynamic_v4) ||
- (remote_addr->sa.sa_family == AF_INET6 && ctx->conf->n_dynamic_v6);
+ return ctx->conf->has_floating || ctx->conf->on_verify;
}
static inline void handle_socket_receive_unknown(fastd_context_t *ctx, fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_buffer_t buffer) {