This is an automated email from the git hooks/post-receive script.
dgoulet pushed a change to branch main in repository tor.
from c080d8b922 Merge branch 'tor-gitlab/mr/577' new 1a19f82a90 ci: install llvm-symbolizer new faced20ddf Merge branch 'tor-gitlab/mr/565' new 851f551dd7 geoip: make geoip_get_country_by_* STATIC new 2a4663fee8 Merge branch 'tor-gitlab/mr/562' new 15e95c3bda Use tor_event_free instead of event_del+tor_free new 0f7a1f0351 Merge branch 'tor-gitlab/mr/561' new f9c3d38917 Fix typo in .gitlab-ci.yml new bae04e6a98 Merge branch 'tor-gitlab/mr/555'
The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: .gitlab-ci.yml | 4 +++- src/core/mainloop/mainloop.c | 12 ++---------- src/feature/control/getinfo_geoip.c | 5 +---- src/lib/geoip/geoip.c | 4 ++-- src/lib/geoip/geoip.h | 6 +++--- src/lib/malloc/malloc.h | 4 ++++ src/test/test_connection.c | 21 +++++---------------- 7 files changed, 20 insertions(+), 36 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit f9c3d38917f6cd8a422fd677ae50ac7e38fdbd97 Author: skaluzka skaluzka@protonmail.com AuthorDate: Sun Mar 27 21:21:40 2022 +0200
Fix typo in .gitlab-ci.yml
-Minmal +Minimal
Signed-off-by: skaluzka skaluzka@protonmail.com --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d033b7ca30..0896a1b7bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -111,7 +111,7 @@ debian-minimal: script: - ./scripts/ci/ci-driver.sh
-# Minmal check on debian/i386: just make, make check. +# Minimal check on debian/i386: just make, make check. # debian-i386-minimal: image: i386/debian:buster
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 15e95c3bda1e3781a7f7175de4e65a749e9d6a2c Author: Alex Xu (Hello71) alex_y_xu@yahoo.ca AuthorDate: Tue Apr 19 22:50:31 2022 -0400
Use tor_event_free instead of event_del+tor_free
Using tor_free is wrong; event_free must be called for objects obtained from event_new. Additionally, this slightly simplifies the code.
Also, add a static_assert to prevent further instances. --- src/core/mainloop/mainloop.c | 12 ++---------- src/lib/malloc/malloc.h | 4 ++++ src/test/test_connection.c | 21 +++++---------------- 3 files changed, 11 insertions(+), 26 deletions(-)
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c index cd57dea3d4..fe763f7d0f 100644 --- a/src/core/mainloop/mainloop.c +++ b/src/core/mainloop/mainloop.c @@ -274,16 +274,8 @@ connection_add_impl(connection_t *conn, int is_connecting) void connection_unregister_events(connection_t *conn) { - if (conn->read_event) { - if (event_del(conn->read_event)) - log_warn(LD_BUG, "Error removing read event for %d", (int)conn->s); - tor_free(conn->read_event); - } - if (conn->write_event) { - if (event_del(conn->write_event)) - log_warn(LD_BUG, "Error removing write event for %d", (int)conn->s); - tor_free(conn->write_event); - } + tor_event_free(conn->read_event); + tor_event_free(conn->write_event); if (conn->type == CONN_TYPE_AP_DNS_LISTENER) { dnsserv_close_listener(conn); } diff --git a/src/lib/malloc/malloc.h b/src/lib/malloc/malloc.h index cc031f843a..48a3ac32cf 100644 --- a/src/lib/malloc/malloc.h +++ b/src/lib/malloc/malloc.h @@ -11,6 +11,7 @@ #ifndef TOR_UTIL_MALLOC_H #define TOR_UTIL_MALLOC_H
+#include <assert.h> #include <stddef.h> #include <stdlib.h> #include "lib/cc/compat_compiler.h" @@ -45,6 +46,9 @@ void tor_free_(void *mem); #ifdef __GNUC__ #define tor_free(p) STMT_BEGIN \ typeof(&(p)) tor_free__tmpvar = &(p); \ + _Static_assert(!__builtin_types_compatible_p(typeof(*tor_free__tmpvar), \ + struct event *), \ + "use tor_event_free for struct event *"); \ raw_free(*tor_free__tmpvar); \ *tor_free__tmpvar=NULL; \ STMT_END diff --git a/src/test/test_connection.c b/src/test/test_connection.c index fbf9d6a5ab..ed94fe8aaa 100644 --- a/src/test/test_connection.c +++ b/src/test/test_connection.c @@ -22,6 +22,7 @@ #include "feature/dircommon/directory.h" #include "core/or/connection_or.h" #include "lib/net/resolve.h" +#include "lib/evloop/compat_libevent.h"
#include "test/test_connection.h" #include "test/test_helpers.h" @@ -113,14 +114,8 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, void *arg) /* We didn't call tor_libevent_initialize(), so event_base was NULL, * so we can't rely on connection_unregister_events() use of event_del(). */ - if (conn->linked_conn->read_event) { - tor_free(conn->linked_conn->read_event); - conn->linked_conn->read_event = NULL; - } - if (conn->linked_conn->write_event) { - tor_free(conn->linked_conn->write_event); - conn->linked_conn->write_event = NULL; - } + tor_event_free(conn->linked_conn->read_event); + tor_event_free(conn->linked_conn->write_event);
if (!conn->linked_conn->marked_for_close) { connection_close_immediate(conn->linked_conn); @@ -142,14 +137,8 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, void *arg) /* We didn't set the events up properly, so we can't use event_del() in * close_closeable_connections() > connection_free() * > connection_unregister_events() */ - if (conn->read_event) { - tor_free(conn->read_event); - conn->read_event = NULL; - } - if (conn->write_event) { - tor_free(conn->write_event); - conn->write_event = NULL; - } + tor_event_free(conn->read_event); + tor_event_free(conn->write_event);
if (!conn->marked_for_close) { connection_close_immediate(conn);
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 851f551dd71e51b66a7788dc5422d618d2b8429a Author: Alex Xu (Hello71) alex_y_xu@yahoo.ca AuthorDate: Sat Apr 23 02:48:32 2022 -0400
geoip: make geoip_get_country_by_* STATIC
slightly simplifies code and reduces compiled size. --- src/feature/control/getinfo_geoip.c | 5 +---- src/lib/geoip/geoip.c | 4 ++-- src/lib/geoip/geoip.h | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/feature/control/getinfo_geoip.c b/src/feature/control/getinfo_geoip.c index be89c2c641..e2d277f256 100644 --- a/src/feature/control/getinfo_geoip.c +++ b/src/feature/control/getinfo_geoip.c @@ -44,10 +44,7 @@ getinfo_helper_geoip(control_connection_t *control_conn, *errmsg = "GeoIP data not loaded"; return -1; } - if (family == AF_INET) - c = geoip_get_country_by_ipv4(tor_addr_to_ipv4h(&addr)); - else /* AF_INET6 */ - c = geoip_get_country_by_ipv6(tor_addr_to_in6(&addr)); + c = geoip_get_country_by_addr(&addr); *answer = tor_strdup(geoip_get_country_name(c)); } return 0; diff --git a/src/lib/geoip/geoip.c b/src/lib/geoip/geoip.c index 686040613d..f13354dbe1 100644 --- a/src/lib/geoip/geoip.c +++ b/src/lib/geoip/geoip.c @@ -387,7 +387,7 @@ geoip_load_file(sa_family_t family, const char *filename, int severity) * be less than geoip_get_n_countries(). To decode it, call * geoip_get_country_name(). */ -int +STATIC int geoip_get_country_by_ipv4(uint32_t ipaddr) { geoip_ipv4_entry_t *ent; @@ -403,7 +403,7 @@ geoip_get_country_by_ipv4(uint32_t ipaddr) * 0 for the 'unknown country'. The return value will always be less than * geoip_get_n_countries(). To decode it, call geoip_get_country_name(). */ -int +STATIC int geoip_get_country_by_ipv6(const struct in6_addr *addr) { geoip_ipv6_entry_t *ent; diff --git a/src/lib/geoip/geoip.h b/src/lib/geoip/geoip.h index 764ed1d5a5..e68573fd1a 100644 --- a/src/lib/geoip/geoip.h +++ b/src/lib/geoip/geoip.h @@ -21,14 +21,14 @@ #ifdef GEOIP_PRIVATE STATIC int geoip_parse_entry(const char *line, sa_family_t family); STATIC void clear_geoip_db(void); + +STATIC int geoip_get_country_by_ipv4(uint32_t ipaddr); +STATIC int geoip_get_country_by_ipv6(const struct in6_addr *addr); #endif /* defined(GEOIP_PRIVATE) */
struct in6_addr; struct tor_addr_t;
-int geoip_get_country_by_ipv4(uint32_t ipaddr); -int geoip_get_country_by_ipv6(const struct in6_addr *addr); - /** A per-country GeoIP record. */ typedef struct geoip_country_t { /** A nul-terminated two-letter country-code. */
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 1a19f82a904e14054088fc15a6fc76a6c8b64f46 Author: Alex Xu (Hello71) alex_y_xu@yahoo.ca AuthorDate: Tue Apr 26 09:39:20 2022 -0400
ci: install llvm-symbolizer --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d033b7ca30..3116d608e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,6 +97,8 @@ variables: - if [ "$STEM" = yes ]; then apt-get install timelimit; fi - if [ "$CC" = clang ]; then apt-get install clang; fi - if [ "$NSS" = yes ]; then apt-get install libnss3 libnss3-dev; fi + # llvm-symbolizer for sanitizer backtrace + - if [ "$HARDENING" = yes ]; then apt-get install llvm; fi # TODO: This next line should not be debian-only. - if [ "$STEM" = yes ]; then git clone --depth 1 https://git.torproject.org/stem.git ; export STEM_PATH="$(pwd)/stem"; fi # TODO: This next line should not be debian-only.
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit faced20ddfb9f38aeea8b3aec4642e9404869cdb Merge: c080d8b922 1a19f82a90 Author: David Goulet dgoulet@torproject.org AuthorDate: Mon May 16 08:42:14 2022 -0400
Merge branch 'tor-gitlab/mr/565'
.gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 2a4663fee839b454b971e6cc9a3c24528a74b5ff Merge: faced20ddf 851f551dd7 Author: David Goulet dgoulet@torproject.org AuthorDate: Mon May 16 08:43:42 2022 -0400
Merge branch 'tor-gitlab/mr/562'
src/feature/control/getinfo_geoip.c | 5 +---- src/lib/geoip/geoip.c | 4 ++-- src/lib/geoip/geoip.h | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit 0f7a1f0351ca88c925641a158cb1c1ea1cc218dc Merge: 2a4663fee8 15e95c3bda Author: David Goulet dgoulet@torproject.org AuthorDate: Mon May 16 08:45:15 2022 -0400
Merge branch 'tor-gitlab/mr/561'
src/core/mainloop/mainloop.c | 12 ++---------- src/lib/malloc/malloc.h | 4 ++++ src/test/test_connection.c | 21 +++++---------------- 3 files changed, 11 insertions(+), 26 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository tor.
commit bae04e6a988dfb5deea86bb848b1649d3b3c3551 Merge: 0f7a1f0351 f9c3d38917 Author: David Goulet dgoulet@torproject.org AuthorDate: Mon May 16 08:45:32 2022 -0400
Merge branch 'tor-gitlab/mr/555'
.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tor-commits@lists.torproject.org