diff options
-rw-r--r-- | src/nat-auto/nat_auto_api.c | 6 | ||||
-rw-r--r-- | 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 | |||
42 | * Configuration we use. | 42 | * Configuration we use. |
43 | */ | 43 | */ |
44 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 44 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Message queue for communicating with the NAT service. | 47 | * Message queue for communicating with the NAT service. |
48 | */ | 48 | */ |
@@ -206,8 +206,8 @@ ah_error_handler (void *cls, | |||
206 | */ | 206 | */ |
207 | struct GNUNET_NAT_AUTO_AutoHandle * | 207 | struct GNUNET_NAT_AUTO_AutoHandle * |
208 | GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 208 | GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
209 | GNUNET_NAT_AUTO_AutoResultCallback cb, | 209 | GNUNET_NAT_AUTO_AutoResultCallback cb, |
210 | void *cb_cls) | 210 | void *cb_cls) |
211 | { | 211 | { |
212 | struct GNUNET_NAT_AUTO_AutoHandle *ah = GNUNET_new (struct GNUNET_NAT_AUTO_AutoHandle); | 212 | struct GNUNET_NAT_AUTO_AutoHandle *ah = GNUNET_new (struct GNUNET_NAT_AUTO_AutoHandle); |
213 | struct GNUNET_MQ_MessageHandler handlers[] = { | 213 | 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 @@ | |||
28 | #include "gnunet_nat_auto_service.h" | 28 | #include "gnunet_nat_auto_service.h" |
29 | #include "nat-auto.h" | 29 | #include "nat-auto.h" |
30 | 30 | ||
31 | #define LOG(kind,...) GNUNET_log_from (kind, "nat", __VA_ARGS__) | 31 | #define LOG(kind,...) GNUNET_log_from (kind, "nat-auto", __VA_ARGS__) |
32 | 32 | ||
33 | #define NAT_SERVER_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) | 33 | #define NAT_SERVER_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) |
34 | 34 | ||
@@ -508,19 +508,21 @@ GNUNET_NAT_AUTO_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
508 | { | 508 | { |
509 | nh->lsock | 509 | nh->lsock |
510 | = GNUNET_NETWORK_socket_create (AF_INET, | 510 | = GNUNET_NETWORK_socket_create (AF_INET, |
511 | proto, | 511 | (IPPROTO_UDP == proto) |
512 | 0); | 512 | ? SOCK_DGRAM |
513 | : SOCK_STREAM, | ||
514 | proto); | ||
513 | if ( (NULL == nh->lsock) || | 515 | if ( (NULL == nh->lsock) || |
514 | (GNUNET_OK != | 516 | (GNUNET_OK != |
515 | GNUNET_NETWORK_socket_bind (nh->lsock, | 517 | GNUNET_NETWORK_socket_bind (nh->lsock, |
516 | (const struct sockaddr *) &sa, | 518 | (const struct sockaddr *) &sa, |
517 | sizeof (sa)))) | 519 | sizeof (sa)))) |
518 | { | 520 | { |
519 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 521 | LOG (GNUNET_ERROR_TYPE_ERROR, |
520 | _("Failed to create listen socket bound to `%s' for NAT test: %s\n"), | 522 | _("Failed to create socket bound to `%s' for NAT test: %s\n"), |
521 | GNUNET_a2s ((const struct sockaddr *) &sa, | 523 | GNUNET_a2s ((const struct sockaddr *) &sa, |
522 | sizeof (sa)), | 524 | sizeof (sa)), |
523 | STRERROR (errno)); | 525 | STRERROR (errno)); |
524 | if (NULL != nh->lsock) | 526 | if (NULL != nh->lsock) |
525 | { | 527 | { |
526 | GNUNET_NETWORK_socket_close (nh->lsock); | 528 | GNUNET_NETWORK_socket_close (nh->lsock); |