From f21a6e3cec1fcc9930f06d3d0b8714cd34718815 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 22 Apr 2012 00:30:09 +0200 Subject: Ignore peers with own key --- src/protocol_ec25519_fhmqvc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c index e4a0e93..719482c 100644 --- a/src/protocol_ec25519_fhmqvc.c +++ b/src/protocol_ec25519_fhmqvc.c @@ -162,6 +162,12 @@ static void protocol_peer_configure(fastd_context *ctx, fastd_peer_config *peer_ return; } + if (memcmp(key.p, ctx->conf->protocol_config->public_key.p, 32) == 0) { + pr_verbose(ctx, "found own key as `%s', ignoring peer", peer_conf->name); + peer_conf->enabled = false; + return; + } + peer_conf->protocol_config = malloc(sizeof(fastd_protocol_peer_config)); peer_conf->protocol_config->public_key = key; } -- cgit v1.2.3