From 1d2444f6264c3b3d4bbf4534b39e2159e71039b0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 24 Apr 2013 13:10:32 +0200 Subject: Initialize local address on peer creation --- src/peer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/peer.c b/src/peer.c index 14af83c..324266a 100644 --- a/src/peer.c +++ b/src/peer.c @@ -133,7 +133,7 @@ static void reset_peer(fastd_context_t *ctx, fastd_peer_t *peer) { free_socket(ctx, peer); - memset(&peer->local_address, 0, sizeof(peer->local_address)), + memset(&peer->local_address, 0, sizeof(peer->local_address)); ctx->conf->protocol->reset_peer_state(ctx, peer); @@ -158,6 +158,8 @@ static void setup_peer(fastd_context_t *ctx, fastd_peer_t *peer) { else peer->address = peer->config->address; + memset(&peer->local_address, 0, sizeof(peer->local_address)); + peer->established = false; peer->last_resolve = (struct timespec){0, 0}; -- cgit v1.2.3