diff options
author | David Goulet <dgoulet@torproject.org> | 2022-11-08 15:25:08 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2022-11-08 15:25:08 -0500 |
commit | 5b0103cfb4a8e3c9807eab8d381cff0cf65d7ab8 (patch) | |
tree | 254c05c53fff5395e0f905d55f98605db93af1ed /src/core | |
parent | 00633bc619046e09536d742e5f862d75c35e476f (diff) | |
parent | 6196e9596a3a10d5b8d2d6574635306d48092388 (diff) | |
download | tor-5b0103cfb4a8e3c9807eab8d381cff0cf65d7ab8.tar.gz tor-5b0103cfb4a8e3c9807eab8d381cff0cf65d7ab8.zip |
Merge branch 'tor-gitlab/mr/651' into maint-0.4.7
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/mainloop/connection.c | 11 | ||||
-rw-r--r-- | src/core/or/connection_edge.c | 4 | ||||
-rw-r--r-- | src/core/or/status.c | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 0a39a7b1ff..b0b297ac57 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -659,7 +659,7 @@ listener_connection_new(int type, int socket_family) connection_init(time(NULL), TO_CONN(listener_conn), type, socket_family); /* Listener connections aren't accounted for with note_connection() so do * this explicitly so to count them. */ - rep_hist_note_conn_opened(false, type); + rep_hist_note_conn_opened(false, type, socket_family); return listener_conn; } @@ -1163,7 +1163,8 @@ connection_mark_for_close_internal_, (connection_t *conn, conn->timestamp_last_write_allowed = time(NULL); /* Note the connection close. */ - rep_hist_note_conn_closed(conn->from_listener, conn->type); + rep_hist_note_conn_closed(conn->from_listener, conn->type, + conn->socket_family); } /** Find each connection that has hold_open_until_flushed set to @@ -2011,7 +2012,7 @@ connection_handle_listener_read(connection_t *conn, int new_type) log_notice(LD_APP, "Denying socks connection from untrusted address %s.", fmt_and_decorate_addr(&addr)); - rep_hist_note_conn_rejected(new_type); + rep_hist_note_conn_rejected(new_type, conn->socket_family); tor_close_socket(news); return 0; } @@ -2021,7 +2022,7 @@ connection_handle_listener_read(connection_t *conn, int new_type) if (dir_policy_permits_address(&addr) == 0) { log_notice(LD_DIRSERV,"Denying dir connection from address %s.", fmt_and_decorate_addr(&addr)); - rep_hist_note_conn_rejected(new_type); + rep_hist_note_conn_rejected(new_type, conn->socket_family); tor_close_socket(news); return 0; } @@ -2030,7 +2031,7 @@ connection_handle_listener_read(connection_t *conn, int new_type) /* Assess with the connection DoS mitigation subsystem if this address * can open a new connection. */ if (dos_conn_addr_get_defense_type(&addr) == DOS_CONN_DEFENSE_CLOSE) { - rep_hist_note_conn_rejected(new_type); + rep_hist_note_conn_rejected(new_type, conn->socket_family); tor_close_socket(news); return 0; } diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index 5ef7a0982b..2b600385e0 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -4209,7 +4209,7 @@ connection_exit_connect(edge_connection_t *edge_conn) log_info(LD_EXIT,"%s failed exit policy%s. Closing.", connection_describe(conn), why_failed_exit_policy); - rep_hist_note_conn_rejected(conn->type); + rep_hist_note_conn_rejected(conn->type, conn->socket_family); connection_edge_end(edge_conn, END_STREAM_REASON_EXITPOLICY); circuit_detach_stream(circuit_get_by_edge_conn(edge_conn), edge_conn); connection_free(conn); @@ -4237,7 +4237,7 @@ connection_exit_connect(edge_connection_t *edge_conn) nodelist_reentry_contains(&conn->addr, conn->port)) { log_info(LD_EXIT, "%s tried to connect back to a known relay address. " "Closing.", connection_describe(conn)); - rep_hist_note_conn_rejected(conn->type); + rep_hist_note_conn_rejected(conn->type, conn->socket_family); connection_edge_end(edge_conn, END_STREAM_REASON_CONNECTREFUSED); circuit_detach_stream(circuit_get_by_edge_conn(edge_conn), edge_conn); connection_free(conn); diff --git a/src/core/or/status.c b/src/core/or/status.c index 601c03becc..11912ffc25 100644 --- a/src/core/or/status.c +++ b/src/core/or/status.c @@ -147,7 +147,7 @@ note_connection(bool inbound, const connection_t *conn) } } - rep_hist_note_conn_opened(inbound, conn->type); + rep_hist_note_conn_opened(inbound, conn->type, conn->socket_family); } /** |