From 9d242f845845ec564b65f4faac080f8483c6b8c2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Feb 2017 15:08:42 +0100 Subject: [PATCH] set type correctly in nat auto test --- src/nat-auto/nat_auto_api.c | 6 +++--- src/nat-auto/nat_auto_api_test.c | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/nat-auto/nat_auto_api.c b/src/nat-auto/nat_auto_api.c index a5b41ac49..6660239c3 100644 --- a/src/nat-auto/nat_auto_api.c +++ b/src/nat-auto/nat_auto_api.c @@ -42,7 +42,7 @@ struct GNUNET_NAT_AUTO_AutoHandle * Configuration we use. */ const struct GNUNET_CONFIGURATION_Handle *cfg; - + /** * Message queue for communicating with the NAT service. */ @@ -206,8 +206,8 @@ ah_error_handler (void *cls, */ struct GNUNET_NAT_AUTO_AutoHandle * GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_NAT_AUTO_AutoResultCallback cb, - void *cb_cls) + GNUNET_NAT_AUTO_AutoResultCallback cb, + void *cb_cls) { struct GNUNET_NAT_AUTO_AutoHandle *ah = GNUNET_new (struct GNUNET_NAT_AUTO_AutoHandle); struct GNUNET_MQ_MessageHandler handlers[] = { diff --git a/src/nat-auto/nat_auto_api_test.c b/src/nat-auto/nat_auto_api_test.c index fb2bcd679..dda0a3b41 100644 --- a/src/nat-auto/nat_auto_api_test.c +++ b/src/nat-auto/nat_auto_api_test.c @@ -28,7 +28,7 @@ #include "gnunet_nat_auto_service.h" #include "nat-auto.h" -#define LOG(kind,...) GNUNET_log_from (kind, "nat", __VA_ARGS__) +#define LOG(kind,...) GNUNET_log_from (kind, "nat-auto", __VA_ARGS__) #define NAT_SERVER_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) @@ -508,19 +508,21 @@ GNUNET_NAT_AUTO_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, { nh->lsock = GNUNET_NETWORK_socket_create (AF_INET, - proto, - 0); + (IPPROTO_UDP == proto) + ? SOCK_DGRAM + : SOCK_STREAM, + proto); if ( (NULL == nh->lsock) || (GNUNET_OK != GNUNET_NETWORK_socket_bind (nh->lsock, (const struct sockaddr *) &sa, sizeof (sa)))) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - _("Failed to create listen socket bound to `%s' for NAT test: %s\n"), - GNUNET_a2s ((const struct sockaddr *) &sa, - sizeof (sa)), - STRERROR (errno)); + LOG (GNUNET_ERROR_TYPE_ERROR, + _("Failed to create socket bound to `%s' for NAT test: %s\n"), + GNUNET_a2s ((const struct sockaddr *) &sa, + sizeof (sa)), + STRERROR (errno)); if (NULL != nh->lsock) { GNUNET_NETWORK_socket_close (nh->lsock); -- 2.25.1