From f5db4fd9c3225e242633d6545f7b764767a938c1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 16 Dec 2016 12:10:19 +0100 Subject: [PATCH] fix shutdown, fix size calculation --- src/nat/gnunet-nat.c | 6 +++--- src/nat/gnunet-service-nat.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c index ff326fe0c..07e65141b 100644 --- a/src/nat/gnunet-nat.c +++ b/src/nat/gnunet-nat.c @@ -401,6 +401,9 @@ run (void *cls, if (use_udp) proto = IPPROTO_UDP; + GNUNET_SCHEDULER_add_shutdown (&do_shutdown, + NULL); + if (do_auto) { ah = GNUNET_NAT_autoconfig_start (c, @@ -501,9 +504,6 @@ run (void *cls, NULL); } - GNUNET_SCHEDULER_add_shutdown (&do_shutdown, - NULL); - if (NULL != remote_addr) { int ret; diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c index 0da854883..4ad6c8d2c 100644 --- a/src/nat/gnunet-service-nat.c +++ b/src/nat/gnunet-service-nat.c @@ -837,7 +837,7 @@ handle_autoconfig_request (void *cls, const struct GNUNET_NAT_AutoconfigRequestMessage *message) { struct ClientHandle *ch = cls; - size_t left = ntohs (message->header.size); + size_t left = ntohs (message->header.size) - sizeof (*message); struct GNUNET_CONFIGURATION_Handle *c; c = GNUNET_CONFIGURATION_create (); -- 2.25.1