summaryrefslogtreecommitdiff
path: root/src/nat-auto
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-16 15:08:42 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-16 15:08:42 +0100
commit9d242f845845ec564b65f4faac080f8483c6b8c2 (patch)
treede40b2d838340a241d16328c54077c04ac18613d /src/nat-auto
parentad22adb15a0c895ac9c25d4c289abf86355a4737 (diff)
set type correctly in nat auto test
Diffstat (limited to 'src/nat-auto')
-rw-r--r--src/nat-auto/nat_auto_api.c6
-rw-r--r--src/nat-auto/nat_auto_api_test.c18
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);