diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app/config/config.c | 10 | ||||
-rw-r--r-- | src/app/config/or_options_st.h | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 5c8a3792ee..9fee83aebb 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -580,6 +580,7 @@ static const config_var_t option_vars_[] = { V(OutboundBindAddress, LINELIST, NULL), V(OutboundBindAddressOR, LINELIST, NULL), V(OutboundBindAddressExit, LINELIST, NULL), + V(OutboundBindAddressPT, LINELIST, NULL), OBSOLETE("PathBiasDisableRate"), V(PathBiasCircThreshold, INT, "-1"), @@ -7180,7 +7181,8 @@ parse_outbound_address_lines(const config_line_t *lines, outbound_addr_t type, "configured: %s", family==AF_INET?" IPv4":(family==AF_INET6?" IPv6":""), type==OUTBOUND_ADDR_OR?" OR": - (type==OUTBOUND_ADDR_EXIT?" exit":""), lines->value); + (type==OUTBOUND_ADDR_EXIT?" exit": + (type==OUTBOUND_ADDR_PT?" PT":"")), lines->value); return -1; } lines = lines->next; @@ -7220,6 +7222,12 @@ parse_outbound_addresses(or_options_t *options, int validate_only, char **msg) goto err; } + if (parse_outbound_address_lines(options->OutboundBindAddressPT, + OUTBOUND_ADDR_PT, options, validate_only, + msg) < 0) { + goto err; + } + return 0; err: return -1; diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h index 9520a1b736..ce3006cc37 100644 --- a/src/app/config/or_options_st.h +++ b/src/app/config/or_options_st.h @@ -34,6 +34,10 @@ typedef enum { * `OutboundBindAddressOR` configuration entry in torrc. */ OUTBOUND_ADDR_OR, + /** Outbound IP address for PT connections. Controlled by the + * `OutboundBindAddressPT` configuration entry in torrc. */ + OUTBOUND_ADDR_PT, + /** Outbound IP address for both Exit and OR connections. Controlled by the * OutboundBindAddress configuration entry in torrc. This value is used as * fallback if the more specific OUTBOUND_ADDR_EXIT and OUTBOUND_ADDR_OR is @@ -146,6 +150,8 @@ struct or_options_t { struct config_line_t *OutboundBindAddressOR; /** Local address to bind outbound exit sockets */ struct config_line_t *OutboundBindAddressExit; + /** Local address to bind outbound PT sockets */ + struct config_line_t *OutboundBindAddressPT; /** Addresses derived from the various OutboundBindAddress lines. * [][0] is IPv4, [][1] is IPv6 */ |