[tor-commits] [tor/master] Whoops. Cant call sockaddr_in a "sin", since sin() is a thing.
commit d5d29cd5a2a0e09afb199f180619cf7a5172f7f9 Author: Nick MathewsonDate: Sun Sep 11 17:59:25 2016 -0400 Whoops. Cant call sockaddr_in a "sin", since sin() is a thing. --- src/test/test_util.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/test_util.c b/src/test/test_util.c index 7d02fed..1edfaa9 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -5101,14 +5101,14 @@ is_there_a_localhost(void) s = tor_open_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); tor_assert(SOCKET_OK(s)); - struct sockaddr_in sin; - memset(, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(0x7f01); - sin.sin_port = 0; + struct sockaddr_in s_in; + memset(_in, 0, sizeof(s_in)); + s_in.sin_family = AF_INET; + s_in.sin_addr.s_addr = htonl(0x7f01); + s_in.sin_port = 0; int result = 0; - if (bind(s, (void*), sizeof(sin)) == 0) { + if (bind(s, (void*)_in, sizeof(s_in)) == 0) { result = 1; } tor_close_socket(s); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Fix gmtime unit test on openbsd
commit ccea2a5aa92f3d6eae62877da8291a8c59d15adb Author: Nick MathewsonDate: Sun Sep 11 17:43:20 2016 -0400 Fix gmtime unit test on openbsd openbsd helpfully handles gmtime() of INT64_MIN. Good job! Our tests didn't handle that so well. --- src/test/test_util.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/test_util.c b/src/test/test_util.c index cb523cf..7d02fed 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -881,7 +881,11 @@ test_util_time(void *arg) b_time.tm_year == (1-1900))) { tt_int_op(b_time.tm_year, OP_EQ, 1970-1900); } -CHECK_TIMEGM_WARNING("Rounding up to "); +if (b_time.tm_year != 1970-1900) { + CHECK_TIMEGM_WARNING("Rounding up to "); +} else { + teardown_capture_of_logs(); +} } #endif ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Try to make our ersatz-socketpair test work better on FreeBSD jails
commit c6e70dacb8e53f28b7e926de81edaf4b25b48848 Author: Nick MathewsonDate: Sun Sep 11 17:28:29 2016 -0400 Try to make our ersatz-socketpair test work better on FreeBSD jails --- src/test/test_util.c | 42 -- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/test/test_util.c b/src/test/test_util.c index 38f2302..cb523cf 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -5090,6 +5090,44 @@ test_util_socket(void *arg) tor_close_socket(fd4); } +static int +is_there_a_localhost(void) +{ + tor_socket_t s; + s = tor_open_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + tor_assert(SOCKET_OK(s)); + + struct sockaddr_in sin; + memset(, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = htonl(0x7f01); + sin.sin_port = 0; + + int result = 0; + if (bind(s, (void*), sizeof(sin)) == 0) { +result = 1; + } + tor_close_socket(s); + if (result) +return result; + + s = tor_open_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + tor_assert(SOCKET_OK(s)); + + struct sockaddr_in6 sin6; + memset(, 0, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_addr.s6_addr[15] = 1; + sin6.sin6_port = 0; + + if (bind(s, (void*), sizeof(sin6)) == 0) { +result = 1; + } + tor_close_socket(s); + + return result; +} + /* Test for socketpair and ersatz_socketpair(). We test them both, since * the latter is a tolerably good way to exersize tor_accept_socket(). */ static void @@ -5108,10 +5146,10 @@ test_util_socketpair(void *arg) * Otherwise, we risk exposing a socketpair on a routable IP address. (Some * BSD jails use a routable address for localhost. Fortunately, they have * the real AF_UNIX socketpair.) */ - if (ersatz && ERRNO_IS_EPROTO(-socketpair_result)) { + if (ersatz && socketpair_result < 0 && !is_there_a_localhost()) { /* In my testing, an IPv6-only FreeBSD jail without ::1 returned EINVAL. * Assume we're on a machine without 127.0.0.1 or ::1 and give up now. */ -goto done; +tt_skip(); } tt_int_op(0, OP_EQ, socketpair_result); ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Tweak tor_gmtime_r test.
commit a671a1c9d632242662bf9fd8b37b63ccefd8a3bf Author: Nick MathewsonDate: Sun Sep 11 17:13:51 2016 -0400 Tweak tor_gmtime_r test. On openbsd64, I'm seeing a warning that the log isn't saying what I'd expect, but I'm not seeing what the answer actually _is_ here. --- src/test/test_util.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/test_util.c b/src/test/test_util.c index 224ec7b..38f2302 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -877,9 +877,11 @@ test_util_time(void *arg) t_res = INT64_MIN; CAPTURE(); tor_gmtime_r(_res, _time); +if (! (b_time.tm_year == (1970-1900) || + b_time.tm_year == (1-1900))) { + tt_int_op(b_time.tm_year, OP_EQ, 1970-1900); +} CHECK_TIMEGM_WARNING("Rounding up to "); -tt_assert(b_time.tm_year == (1970-1900) || - b_time.tm_year == (1-1900)); } #endif ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Re-run trunnel.
commit 25513ae174d80a62ca0a8dcca52683089be95ea3 Author: Nick MathewsonDate: Thu Jul 28 10:52:43 2016 -0400 Re-run trunnel. --- src/ext/trunnel/trunnel-impl.h | 8 src/ext/trunnel/trunnel.c | 4 ++-- src/ext/trunnel/trunnel.h | 2 +- src/trunnel/ed25519_cert.c | 6 +++--- src/trunnel/ed25519_cert.h | 2 +- src/trunnel/link_handshake.c | 12 ++-- src/trunnel/link_handshake.h | 2 +- src/trunnel/pwbox.c| 6 +++--- src/trunnel/pwbox.h| 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/ext/trunnel/trunnel-impl.h b/src/ext/trunnel/trunnel-impl.h index dfe5f89..3ffde6e 100644 --- a/src/ext/trunnel/trunnel-impl.h +++ b/src/ext/trunnel/trunnel-impl.h @@ -1,4 +1,4 @@ -/* trunnel-impl.h -- copied from Trunnel v1.4.4 +/* trunnel-impl.h -- copied from Trunnel v1.4.6 * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ @@ -11,12 +11,12 @@ #ifndef TRUNNEL_IMPL_H_INCLUDED_ #define TRUNNEL_IMPL_H_INCLUDED_ -#include "trunnel.h" -#include -#include #ifdef TRUNNEL_LOCAL_H #include "trunnel-local.h" #endif +#include "trunnel.h" +#include +#include #if defined(_MSC_VER) && (_MSC_VER < 1600) #define uint8_t unsigned char diff --git a/src/ext/trunnel/trunnel.c b/src/ext/trunnel/trunnel.c index 0ed75aa..3994422 100644 --- a/src/ext/trunnel/trunnel.c +++ b/src/ext/trunnel/trunnel.c @@ -1,4 +1,4 @@ -/* trunnel.c -- copied from Trunnel v1.4.4 +/* trunnel.c -- copied from Trunnel v1.4.6 * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ @@ -10,9 +10,9 @@ * See trunnel-impl.h for documentation of these functions. */ +#include "trunnel-impl.h" #include #include -#include "trunnel-impl.h" #if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ diff --git a/src/ext/trunnel/trunnel.h b/src/ext/trunnel/trunnel.h index 62e87ee..41068b8 100644 --- a/src/ext/trunnel/trunnel.h +++ b/src/ext/trunnel/trunnel.h @@ -1,4 +1,4 @@ -/* trunnel.h -- copied from Trunnel v1.4.4 +/* trunnel.h -- copied from Trunnel v1.4.6 * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ diff --git a/src/trunnel/ed25519_cert.c b/src/trunnel/ed25519_cert.c index f495743..24988d5 100644 --- a/src/trunnel/ed25519_cert.c +++ b/src/trunnel/ed25519_cert.c @@ -1,4 +1,4 @@ -/* ed25519_cert.c -- generated by Trunnel v1.4.4. +/* ed25519_cert.c -- generated by Trunnel v1.4.6. * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ @@ -157,7 +157,7 @@ ed25519_cert_extension_setlen_un_unparsed(ed25519_cert_extension_t *inp, size_t >un_unparsed.n_, inp->un_unparsed.elts_, newlen, sizeof(inp->un_unparsed.elts_[0]), (trunnel_free_fn_t) NULL, >trunnel_error_code_); - if (newptr == NULL) + if (newlen != 0 && newptr == NULL) goto trunnel_alloc_failed; inp->un_unparsed.elts_ = newptr; return 0; @@ -589,7 +589,7 @@ ed25519_cert_setlen_ext(ed25519_cert_t *inp, size_t newlen) >ext.n_, inp->ext.elts_, newlen, sizeof(inp->ext.elts_[0]), (trunnel_free_fn_t) ed25519_cert_extension_free, >trunnel_error_code_); - if (newptr == NULL) + if (newlen != 0 && newptr == NULL) goto trunnel_alloc_failed; inp->ext.elts_ = newptr; return 0; diff --git a/src/trunnel/ed25519_cert.h b/src/trunnel/ed25519_cert.h index 75a82d8..28f6fee 100644 --- a/src/trunnel/ed25519_cert.h +++ b/src/trunnel/ed25519_cert.h @@ -1,4 +1,4 @@ -/* ed25519_cert.h -- generated by by Trunnel v1.4.4. +/* ed25519_cert.h -- generated by by Trunnel v1.4.6. * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ diff --git a/src/trunnel/link_handshake.c b/src/trunnel/link_handshake.c index 3ef7341..c2717f3 100644 --- a/src/trunnel/link_handshake.c +++ b/src/trunnel/link_handshake.c @@ -1,4 +1,4 @@ -/* link_handshake.c -- generated by Trunnel v1.4.4. +/* link_handshake.c -- generated by Trunnel v1.4.6. * https://gitweb.torproject.org/trunnel.git * You probably shouldn't edit this file. */ @@ -143,7 +143,7 @@ auth_challenge_cell_setlen_methods(auth_challenge_cell_t *inp, size_t newlen) >methods.n_, inp->methods.elts_, newlen, sizeof(inp->methods.elts_[0]), (trunnel_free_fn_t) NULL, >trunnel_error_code_); - if (newptr == NULL) + if (newlen != 0 && newptr == NULL) goto trunnel_alloc_failed; inp->methods.elts_ = newptr; return 0; @@ -452,7 +452,7 @@ certs_cell_cert_setlen_body(certs_cell_cert_t *inp, size_t newlen) >body.n_, inp->body.elts_, newlen, sizeof(inp->body.elts_[0]), (trunnel_free_fn_t) NULL, >trunnel_error_code_); - if (newptr == NULL) + if (newlen != 0 &&
[tor-commits] [tor/master] changes file for 19767
commit 9d84a6d998f11ff1667fce8e22c9241756880cf8 Author: Nick MathewsonDate: Sun Sep 11 16:53:37 2016 -0400 changes file for 19767 --- changes/bug19767 | 4 1 file changed, 4 insertions(+) diff --git a/changes/bug19767 b/changes/bug19767 new file mode 100644 index 000..f0a010b --- /dev/null +++ b/changes/bug19767 @@ -0,0 +1,4 @@ + o Minor bugfixes (compilation): +- Always include orconfig.h before including any other C headers. + Sometimes, it includes macros that affect the behavior of the + standard headers. Closes bug 19767. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Merge remote-tracking branch 'public/solaris_warnings_028'
commit 64521a9d355da9f21d81c8a82056e544372685b2 Merge: 77e2be0 25513ae Author: Nick MathewsonDate: Sun Sep 11 16:52:24 2016 -0400 Merge remote-tracking branch 'public/solaris_warnings_028' src/common/address.c| 1 + src/common/crypto.h | 2 ++ src/common/util.c | 4 ++-- src/ext/ed25519/donna/ed25519_tor.c | 2 +- src/ext/ed25519/ref10/keypair.c | 3 ++- src/ext/ed25519/ref10/open.c| 3 ++- src/ext/trunnel/trunnel-impl.h | 8 src/ext/trunnel/trunnel.c | 4 ++-- src/ext/trunnel/trunnel.h | 2 +- src/or/circuitmux_ewma.c| 2 ++ src/test/test-child.c | 2 +- src/test/test-memwipe.c | 1 + src/test/test_channeltls.c | 2 ++ src/test/test_scheduler.c | 3 +-- src/test/test_status.c | 2 ++ src/trunnel/ed25519_cert.c | 6 +++--- src/trunnel/ed25519_cert.h | 2 +- src/trunnel/link_handshake.c| 12 ++-- src/trunnel/link_handshake.h| 2 +- src/trunnel/pwbox.c | 6 +++--- src/trunnel/pwbox.h | 2 +- 21 files changed, 41 insertions(+), 30 deletions(-) diff --cc src/test/test_scheduler.c index 2e0736f,db331cb..05ea8e8 --- a/src/test/test_scheduler.c +++ b/src/test/test_scheduler.c @@@ -1,11 -1,16 +1,10 @@@ /* Copyright (c) 2014-2016, The Tor Project, Inc. */ /* See LICENSE for licensing information */ - #include - #include "orconfig.h" + #include - -/* Libevent stuff */ -#ifdef HAVE_EVENT2_EVENT_H #include -#else -#include -#endif #define TOR_CHANNEL_INTERNAL_ #define CHANNEL_PRIVATE_ ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Fix a large pile of solaris warnings for bug 19767.
commit 94bff894f9e127888f15ec2333f86d0388e4da7d Author: Nick MathewsonDate: Thu Jul 28 10:47:46 2016 -0400 Fix a large pile of solaris warnings for bug 19767. In nearly all cases, this is a matter of making sure that we include orconfig.h before we include any standard c headers. --- src/common/address.c| 1 + src/common/crypto.h | 2 ++ src/common/util.c | 4 ++-- src/ext/ed25519/donna/ed25519_tor.c | 2 +- src/ext/ed25519/ref10/keypair.c | 3 ++- src/ext/ed25519/ref10/open.c| 3 ++- src/or/circuitmux_ewma.c| 2 ++ src/test/test-child.c | 2 +- src/test/test-memwipe.c | 1 + src/test/test_channeltls.c | 2 ++ src/test/test_scheduler.c | 4 ++-- src/test/test_status.c | 2 ++ 12 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/common/address.c b/src/common/address.c index 793a40e..c514588 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1595,6 +1595,7 @@ get_interface_addresses_raw,(int severity, sa_family_t family)) return result; #endif (void) severity; + (void) result; return NULL; } diff --git a/src/common/crypto.h b/src/common/crypto.h index 682c4e3..e4d3d06 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -13,6 +13,8 @@ #ifndef TOR_CRYPTO_H #define TOR_CRYPTO_H +#include "orconfig.h" + #include #include "torint.h" #include "testsupport.h" diff --git a/src/common/util.c b/src/common/util.c index f3effe0..a100f37 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -4548,13 +4548,13 @@ tor_get_exit_code(process_handle_t *process_handle, return PROCESS_EXIT_RUNNING; } else if (retval != process_handle->pid) { log_warn(LD_GENERAL, "waitpid() failed for PID %d: %s", - process_handle->pid, strerror(errno)); + (int)process_handle->pid, strerror(errno)); return PROCESS_EXIT_ERROR; } if (!WIFEXITED(stat_loc)) { log_warn(LD_GENERAL, "Process %d did not exit normally", - process_handle->pid); + (int)process_handle->pid); return PROCESS_EXIT_ERROR; } diff --git a/src/ext/ed25519/donna/ed25519_tor.c b/src/ext/ed25519/donna/ed25519_tor.c index 52b259d..5f3fdc5 100644 --- a/src/ext/ed25519/donna/ed25519_tor.c +++ b/src/ext/ed25519/donna/ed25519_tor.c @@ -34,7 +34,7 @@ #define ED25519_FN2(fn,suffix) ED25519_FN3(fn,suffix) #define ED25519_FN(fn) ED25519_FN2(fn,ED25519_SUFFIX) - +#include "orconfig.h" #include "ed25519-donna.h" #include "ed25519_donna_tor.h" #include "ed25519-randombytes.h" diff --git a/src/ext/ed25519/ref10/keypair.c b/src/ext/ed25519/ref10/keypair.c index 7ddbaa9..68a88f9 100644 --- a/src/ext/ed25519/ref10/keypair.c +++ b/src/ext/ed25519/ref10/keypair.c @@ -1,6 +1,7 @@ /* Modified for Tor: new API, 64-byte secret keys. */ -#include + #include "randombytes.h" +#include #include "crypto_sign.h" #include "crypto_hash_sha512.h" #include "ge.h" diff --git a/src/ext/ed25519/ref10/open.c b/src/ext/ed25519/ref10/open.c index 9dbeb4c..3ab7b7d 100644 --- a/src/ext/ed25519/ref10/open.c +++ b/src/ext/ed25519/ref10/open.c @@ -1,6 +1,7 @@ /* (Modified by Tor to verify signature separately from message) */ -#include + #include "crypto_sign.h" +#include #include "crypto_hash_sha512.h" #include "crypto_verify_32.h" #include "ge.h" diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c index b784a14..13836cd 100644 --- a/src/or/circuitmux_ewma.c +++ b/src/or/circuitmux_ewma.c @@ -8,6 +8,8 @@ #define TOR_CIRCUITMUX_EWMA_C_ +#include "orconfig.h" + #include #include "or.h" diff --git a/src/test/test-child.c b/src/test/test-child.c index e2552a4..fdf3cce 100644 --- a/src/test/test-child.c +++ b/src/test/test-child.c @@ -1,8 +1,8 @@ /* Copyright (c) 2011-2016, The Tor Project, Inc. */ /* See LICENSE for licensing information */ -#include #include "orconfig.h" +#include #ifdef _WIN32 #define WINDOWS_LEAN_AND_MEAN #include diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c index 5d4fcec..2689b95 100644 --- a/src/test/test-memwipe.c +++ b/src/test/test-memwipe.c @@ -1,3 +1,4 @@ +#include "orconfig.h" #include #include #include diff --git a/src/test/test_channeltls.c b/src/test/test_channeltls.c index 04ae9a6..fda466f 100644 --- a/src/test/test_channeltls.c +++ b/src/test/test_channeltls.c @@ -1,6 +1,8 @@ /* Copyright (c) 2014-2016, The Tor Project, Inc. */ /* See LICENSE for licensing information */ +#include "orconfig.h" + #include #define TOR_CHANNEL_INTERNAL_ diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c index 6e9889b..db331cb 100644 --- a/src/test/test_scheduler.c +++ b/src/test/test_scheduler.c @@ -1,10 +1,10 @@ /* Copyright (c) 2014-2016, The Tor Project, Inc. */ /* See LICENSE for licensing information */ -#include - #include "orconfig.h" +#include + /* Libevent
[tor-commits] [doctor/master] Disable check for BadExit being in sync
commit c3f7557b55b865ad9a6d80815c746974addf4dbc Author: Damian JohnsonDate: Sun Sep 11 11:11:50 2016 -0700 Disable check for BadExit being in sync Authorities have been out of sync for months with no sign it'll be fixed. Disabling the check. --- consensus_health_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus_health_checker.py b/consensus_health_checker.py index a2859e9..f5ab3d2 100755 --- a/consensus_health_checker.py +++ b/consensus_health_checker.py @@ -322,7 +322,7 @@ def run_checks(consensuses, votes): #unmeasured_relays, has_authority_flag, is_recommended_versions, -bad_exits_in_sync, +#bad_exits_in_sync, bandwidth_authorities_in_sync, is_orport_reachable, ) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [depictor/master] Add historical data to gitignore and remove globe links
commit 8c8fbe42d0a63d7a9bd37b9b1fd96b3f18ddfb71 Author: TomDate: Sun Sep 11 12:56:09 2016 -0500 Add historical data to gitignore and remove globe links --- .gitignore | 3 ++- website.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f65ade4..45104d6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ out/index.html out/graphs.html out/vote-stats.csv out/consensus-health* -out/download-stats.csv \ No newline at end of file +out/download-stats.csv +data/historical.db \ No newline at end of file diff --git a/website.py b/website.py index fb64cee..bdc1d5e 100755 --- a/website.py +++ b/website.py @@ -900,8 +900,7 @@ class WebsiteWriter: + relay_nickname \ + " https://atlas.torproject.org/#details/; \ + relay_fp + "\">Atlas | " \ - + "https://globe.torproject.org/#/relay/; + relay_fp \ - + "\">Globe | " \ + "\n") ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits