mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Bulletproof conn_get_outbound_address() a little.
This commit is contained in:
parent
782c52658c
commit
795582169a
1 changed files with 11 additions and 3 deletions
|
@ -1902,10 +1902,18 @@ conn_get_outbound_address(sa_family_t family,
|
||||||
{
|
{
|
||||||
const tor_addr_t *ext_addr = NULL;
|
const tor_addr_t *ext_addr = NULL;
|
||||||
|
|
||||||
int fam_index=0;
|
int fam_index;
|
||||||
if (family==AF_INET6) {
|
switch (family) {
|
||||||
|
case AF_INET:
|
||||||
|
fam_index = 0;
|
||||||
|
break;
|
||||||
|
case AF_INET6:
|
||||||
fam_index = 1;
|
fam_index = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If an exit connection, use the exit address (if present)
|
// If an exit connection, use the exit address (if present)
|
||||||
if (conn_type == CONN_TYPE_EXIT) {
|
if (conn_type == CONN_TYPE_EXIT) {
|
||||||
if (!tor_addr_is_null(
|
if (!tor_addr_is_null(
|
||||||
|
|
Loading…
Add table
Reference in a new issue