diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-26 22:13:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-26 22:13:01 +0000 |
commit | 64d3e46cfb99a711e500fa1f114e7c44bdf10040 (patch) | |
tree | 83093d92761d5c1b8b2fded713adaa19af29274c /src/pt/test_gnunet_vpn.c | |
parent | ef6f05f63769263a5201636c4b7f71eaa455cdf3 (diff) | |
download | gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.tar.gz gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.zip |
-bugfixes, code cleanup
Diffstat (limited to 'src/pt/test_gnunet_vpn.c')
-rw-r--r-- | src/pt/test_gnunet_vpn.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c index 72551e353..8b9bb2b20 100644 --- a/src/pt/test_gnunet_vpn.c +++ b/src/pt/test_gnunet_vpn.c | |||
@@ -390,30 +390,6 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
390 | } | 390 | } |
391 | 391 | ||
392 | 392 | ||
393 | /** | ||
394 | * Test if the given AF is supported by this system. | ||
395 | * | ||
396 | * @param af to test | ||
397 | * @return GNUNET_OK if the AF is supported | ||
398 | */ | ||
399 | static int | ||
400 | test_af (int af) | ||
401 | { | ||
402 | int s; | ||
403 | |||
404 | s = socket (af, SOCK_STREAM, 0); | ||
405 | if (-1 == s) | ||
406 | { | ||
407 | if (EAFNOSUPPORT == errno) | ||
408 | return GNUNET_NO; | ||
409 | fprintf (stderr, "Failed to create test socket: %s\n", STRERROR (errno)); | ||
410 | return GNUNET_SYSERR; | ||
411 | } | ||
412 | close (s); | ||
413 | return GNUNET_OK; | ||
414 | } | ||
415 | |||
416 | |||
417 | int | 393 | int |
418 | main (int argc, char *const *argv) | 394 | main (int argc, char *const *argv) |
419 | { | 395 | { |
@@ -476,7 +452,8 @@ main (int argc, char *const *argv) | |||
476 | fprintf (stderr, "invalid binary suffix `%s'\n", type); | 452 | fprintf (stderr, "invalid binary suffix `%s'\n", type); |
477 | return 1; | 453 | return 1; |
478 | } | 454 | } |
479 | if ((GNUNET_OK != test_af (src_af)) || (GNUNET_OK != test_af (dest_af))) | 455 | if ((GNUNET_OK != GNUNET_NETWORK_test_pf (src_af)) || |
456 | (GNUNET_OK != GNUNET_NETWORK_test_pf (dest_af))) | ||
480 | { | 457 | { |
481 | fprintf (stderr, | 458 | fprintf (stderr, |
482 | "Required address families not supported by this system, skipping test.\n"); | 459 | "Required address families not supported by this system, skipping test.\n"); |