From: Christian Grothoff Date: Fri, 16 Dec 2016 11:10:19 +0000 (+0100) Subject: fix shutdown, fix size calculation X-Git-Tag: taler-0.2.1~558 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f5db4fd9c3225e242633d6545f7b764767a938c1;p=oweals%2Fgnunet.git fix shutdown, fix size calculation --- 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 ();