From 4010ddcde362ec1c40c33d2d419398b010a5a961 Mon Sep 17 00:00:00 2001 From: Artem Prilutskiy Date: Thu, 4 Aug 2016 21:35:16 +0300 Subject: [PATCH] Fixed reconnect issue --- CronosAgent.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CronosAgent.c b/CronosAgent.c index 78a78dc..6ad260d 100644 --- a/CronosAgent.c +++ b/CronosAgent.c @@ -585,6 +585,10 @@ int main(int argc, const char* argv[]) outgoingBuffer->length = htole16(SHA256_DIGEST_LENGTH); sendto(uplinkHandle, outgoingBuffer, sizeof(struct RewindData) + SHA256_DIGEST_LENGTH, 0, serverAddress->ai_addr, serverAddress->ai_addrlen); + + socketOptionValue = true; + setsockopt(remoteHandle, IPPROTO_IP, IP_PKTINFO, &socketOptionValue, sizeof(socketOptionValue)); + continue; } @@ -797,10 +801,6 @@ int main(int argc, const char* argv[]) break; } - // SIGHUP - - socketOptionValue = true; - setsockopt(remoteHandle, IPPROTO_IP, IP_PKTINFO, &socketOptionValue, sizeof(socketOptionValue)); } } }