diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-16 15:08:42 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-16 15:08:42 +0100 |
commit | 9d242f845845ec564b65f4faac080f8483c6b8c2 (patch) | |
tree | de40b2d838340a241d16328c54077c04ac18613d /src/nat-auto/nat_auto_api_test.c | |
parent | ad22adb15a0c895ac9c25d4c289abf86355a4737 (diff) | |
download | gnunet-9d242f845845ec564b65f4faac080f8483c6b8c2.tar.gz gnunet-9d242f845845ec564b65f4faac080f8483c6b8c2.zip |
set type correctly in nat auto test
Diffstat (limited to 'src/nat-auto/nat_auto_api_test.c')
-rw-r--r-- | src/nat-auto/nat_auto_api_test.c | 18 |
1 files changed, 10 insertions, 8 deletions
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); |