aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2014-12-20 22:27:21 +1100
committerteor <teor2345@gmail.com>2014-12-20 22:28:58 +1100
commitd93516c445cfb25904da3d86fd6096cce1179b59 (patch)
tree23f838753355691c8ebd0fb35ca05132d52e244c /src/or/config.c
parentf7e8bc2b4bc0d6072a337d9420cd5cd395c9f9d2 (diff)
downloadtor-d93516c445cfb25904da3d86fd6096cce1179b59.tar.gz
tor-d93516c445cfb25904da3d86fd6096cce1179b59.zip
Fix transparent proxy checks to allow OS X to use ipfw or pf
OS X uses ipfw (FreeBSD) or pf (OpenBSD). Update the transparent proxy option checks to allow for both ipfw and pf on OS X. Fixes bug 14002.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 28f1df0663..da756f6f29 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2597,20 +2597,24 @@ options_validate(or_options_t *old_options, or_options_t *options,
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.");
+#if !defined(__OpenBSD__) && !defined( DARWIN )
+ /* Later versions of OS X have pf */
+ REJECT("pf-divert is a OpenBSD-specific "
+ "and OS X/Darwin-specific feature.");
#else
options->TransProxyType_parsed = TPT_PF_DIVERT;
#endif
} else if (!strcasecmp(options->TransProxyType, "tproxy")) {
-#ifndef __linux__
+#if !defined(__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.");
+#if !defined(__FreeBSD__) && !defined( DARWIN )
+ /* Earlier versions of OS X have ipfw */
+ REJECT("ipfw is a FreeBSD-specific"
+ "and OS X/Darwin-specific feature.");
#else
options->TransProxyType_parsed = TPT_IPFW;
#endif