diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-16 23:03:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-16 23:03:41 -0400 |
commit | 973661394abc393e3dfd5b82de86659ecadc72a4 (patch) | |
tree | 01656cbb45711c0c8800786c386d65c1f1e24c01 /src/or/config.c | |
parent | 211b8cc31846e2d2ba75f19ab9f319f18cb70cfb (diff) | |
parent | f9719b078141fb1a4a0eee281031c73cffde7c30 (diff) | |
download | tor-973661394abc393e3dfd5b82de86659ecadc72a4.tar.gz tor-973661394abc393e3dfd5b82de86659ecadc72a4.zip |
Merge branch '10267_plus_10896_rebased_twice'
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index ca99d014fc..23a63ccd24 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1089,7 +1089,8 @@ options_act_reversible(const or_options_t *old_options, char **msg) #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_PFVAR_H) /* Open /dev/pf before dropping privileges. */ - if (options->TransPort_set) { + if (options->TransPort_set && + options->TransProxyType_parsed == TPT_DEFAULT) { if (get_pf_socket() < 0) { *msg = tor_strdup("Unable to open /dev/pf for transparent proxy."); goto rollback; @@ -2553,12 +2554,24 @@ options_validate(or_options_t *old_options, or_options_t *options, if (options->TransProxyType) { if (!strcasecmp(options->TransProxyType, "default")) { options->TransProxyType_parsed = TPT_DEFAULT; + } else if (!strcasecmp(options->TransProxyType, "pf-divert")) { +#ifndef __OpenBSD__ + REJECT("pf-divert is a OpenBSD-specific feature."); +#else + options->TransProxyType_parsed = TPT_PF_DIVERT; +#endif } else if (!strcasecmp(options->TransProxyType, "tproxy")) { #ifndef __linux__ REJECT("TPROXY is a Linux-specific feature."); #else options->TransProxyType_parsed = TPT_TPROXY; #endif + } else if (!strcasecmp(options->TransProxyType, "ipfw")) { +#ifndef __FreeBSD__ + REJECT("ipfw is a FreeBSD-specific feature."); +#else + options->TransProxyType_parsed = TPT_IPFW; +#endif } else { REJECT("Unrecognized value for TransProxyType"); } |