summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-04-24 13:10:32 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-04-24 13:10:32 +0200
commit1d2444f6264c3b3d4bbf4534b39e2159e71039b0 (patch)
tree47b74e77be0ef3962277cb98135be1503c93071b /src
parentadaedb9299c77e18150b685a96d51b1ce67ec423 (diff)
downloadfastd-1d2444f6264c3b3d4bbf4534b39e2159e71039b0.tar
fastd-1d2444f6264c3b3d4bbf4534b39e2159e71039b0.zip
Initialize local address on peer creation
Diffstat (limited to 'src')
-rw-r--r--src/peer.c4
1 files changed, 3 insertions, 1 deletions
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};