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_gns_vpn.c | |
parent | ef6f05f63769263a5201636c4b7f71eaa455cdf3 (diff) | |
download | gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.tar.gz gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.zip |
-bugfixes, code cleanup
Diffstat (limited to 'src/pt/test_gns_vpn.c')
-rw-r--r-- | src/pt/test_gns_vpn.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c index 7d2cd7ba4..32283bad4 100644 --- a/src/pt/test_gns_vpn.c +++ b/src/pt/test_gns_vpn.c | |||
@@ -415,30 +415,6 @@ run (void *cls, | |||
415 | 415 | ||
416 | 416 | ||
417 | /** | 417 | /** |
418 | * Test if the given AF is supported by this system. | ||
419 | * | ||
420 | * @param af to test | ||
421 | * @return GNUNET_OK if the AF is supported | ||
422 | */ | ||
423 | static int | ||
424 | test_af (int af) | ||
425 | { | ||
426 | int s; | ||
427 | |||
428 | s = socket (af, SOCK_STREAM, 0); | ||
429 | if (-1 == s) | ||
430 | { | ||
431 | if (EAFNOSUPPORT == errno) | ||
432 | return GNUNET_NO; | ||
433 | fprintf (stderr, "Failed to create test socket: %s\n", STRERROR (errno)); | ||
434 | return GNUNET_SYSERR; | ||
435 | } | ||
436 | close (s); | ||
437 | return GNUNET_OK; | ||
438 | } | ||
439 | |||
440 | |||
441 | /** | ||
442 | * Open '/dev/null' and make the result the given | 418 | * Open '/dev/null' and make the result the given |
443 | * file descriptor. | 419 | * file descriptor. |
444 | * | 420 | * |
@@ -579,13 +555,13 @@ main (int argc, char *const *argv) | |||
579 | dest_af = AF_INET; | 555 | dest_af = AF_INET; |
580 | src_af = AF_INET; | 556 | src_af = AF_INET; |
581 | 557 | ||
582 | if (GNUNET_OK == test_af (AF_INET6)) | 558 | if (GNUNET_OK == GNUNET_NETWORK_test_pf (PF_INET6)) |
583 | use_v6 = GNUNET_YES; | 559 | use_v6 = GNUNET_YES; |
584 | else | 560 | else |
585 | use_v6 = GNUNET_NO; | 561 | use_v6 = GNUNET_NO; |
586 | 562 | ||
587 | if ( (GNUNET_OK != test_af (src_af)) || | 563 | if ( (GNUNET_OK != GNUNET_NETWORK_test_pf (src_af)) || |
588 | (GNUNET_OK != test_af (dest_af)) ) | 564 | (GNUNET_OK != GNUNET_NETWORK_test_pf (dest_af)) ) |
589 | { | 565 | { |
590 | fprintf (stderr, | 566 | fprintf (stderr, |
591 | "Required address families not supported by this system, skipping test.\n"); | 567 | "Required address families not supported by this system, skipping test.\n"); |