Loading changes/bug8639 0 → 100644 +5 −0 Original line number Diff line number Diff line o Normal bugfixes: - When launching a resolve request on behalf of an AF_UNIX control socket, omit the address field of the new entry connection, used in subsequent controller events, rather than letting tor_dup_addr() set it to "<unknown address type>". Fixes bug 8639. src/or/control.c +15 −2 Original line number Diff line number Diff line Loading @@ -3744,8 +3744,21 @@ control_event_stream_status(entry_connection_t *conn, stream_status_event_t tp, } if (tp == STREAM_EVENT_NEW || tp == STREAM_EVENT_NEW_RESOLVE) { /* * When the control conn is an AF_UNIX socket and we have no address, * it gets set to "(Tor_internal)"; see dnsserv_launch_request() in * dnsserv.c. */ if (strcmp(ENTRY_TO_CONN(conn)->address, "(Tor_internal)") != 0) { tor_snprintf(addrport_buf,sizeof(addrport_buf), " SOURCE_ADDR=%s:%d", ENTRY_TO_CONN(conn)->address, ENTRY_TO_CONN(conn)->port); } else { /* * else leave it blank so control on AF_UNIX doesn't need to make * something up. */ addrport_buf[0] = '\0'; } } else { addrport_buf[0] = '\0'; } Loading src/or/dnsserv.c +15 −0 Original line number Diff line number Diff line Loading @@ -183,8 +183,23 @@ dnsserv_launch_request(const char *name, int reverse, conn->base_.state = AP_CONN_STATE_RESOLVE_WAIT; tor_addr_copy(&TO_CONN(conn)->addr, &control_conn->base_.addr); #ifdef AF_UNIX /* * The control connection can be AF_UNIX and if so tor_dup_addr will * unhelpfully say "<unknown address type>"; say "(Tor_internal)" * instead. */ if (control_conn->base_.socket_family == AF_UNIX) { TO_CONN(conn)->port = 0; TO_CONN(conn)->address = tor_strdup("(Tor_internal)"); } else { TO_CONN(conn)->port = control_conn->base_.port; TO_CONN(conn)->address = tor_dup_addr(&control_conn->base_.addr); } #else TO_CONN(conn)->port = control_conn->base_.port; TO_CONN(conn)->address = tor_dup_addr(&control_conn->base_.addr); #endif if (reverse) entry_conn->socks_request->command = SOCKS_COMMAND_RESOLVE_PTR; Loading Loading
changes/bug8639 0 → 100644 +5 −0 Original line number Diff line number Diff line o Normal bugfixes: - When launching a resolve request on behalf of an AF_UNIX control socket, omit the address field of the new entry connection, used in subsequent controller events, rather than letting tor_dup_addr() set it to "<unknown address type>". Fixes bug 8639.
src/or/control.c +15 −2 Original line number Diff line number Diff line Loading @@ -3744,8 +3744,21 @@ control_event_stream_status(entry_connection_t *conn, stream_status_event_t tp, } if (tp == STREAM_EVENT_NEW || tp == STREAM_EVENT_NEW_RESOLVE) { /* * When the control conn is an AF_UNIX socket and we have no address, * it gets set to "(Tor_internal)"; see dnsserv_launch_request() in * dnsserv.c. */ if (strcmp(ENTRY_TO_CONN(conn)->address, "(Tor_internal)") != 0) { tor_snprintf(addrport_buf,sizeof(addrport_buf), " SOURCE_ADDR=%s:%d", ENTRY_TO_CONN(conn)->address, ENTRY_TO_CONN(conn)->port); } else { /* * else leave it blank so control on AF_UNIX doesn't need to make * something up. */ addrport_buf[0] = '\0'; } } else { addrport_buf[0] = '\0'; } Loading
src/or/dnsserv.c +15 −0 Original line number Diff line number Diff line Loading @@ -183,8 +183,23 @@ dnsserv_launch_request(const char *name, int reverse, conn->base_.state = AP_CONN_STATE_RESOLVE_WAIT; tor_addr_copy(&TO_CONN(conn)->addr, &control_conn->base_.addr); #ifdef AF_UNIX /* * The control connection can be AF_UNIX and if so tor_dup_addr will * unhelpfully say "<unknown address type>"; say "(Tor_internal)" * instead. */ if (control_conn->base_.socket_family == AF_UNIX) { TO_CONN(conn)->port = 0; TO_CONN(conn)->address = tor_strdup("(Tor_internal)"); } else { TO_CONN(conn)->port = control_conn->base_.port; TO_CONN(conn)->address = tor_dup_addr(&control_conn->base_.addr); } #else TO_CONN(conn)->port = control_conn->base_.port; TO_CONN(conn)->address = tor_dup_addr(&control_conn->base_.addr); #endif if (reverse) entry_conn->socks_request->command = SOCKS_COMMAND_RESOLVE_PTR; Loading