summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/config.h4
-rw-r--r--src/test/test_options.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index ad4138a3ca..4f4b9dfbfd 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2861,7 +2861,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
options->TransProxyType_parsed = TPT_TPROXY;
#endif
} else if (!strcasecmp(options->TransProxyType, "ipfw")) {
-#if !defined(__FreeBSD_kernel__) && !defined( DARWIN )
+#ifndef KERNEL_MAY_SUPPORT_IPFW
/* Earlier versions of OS X have ipfw */
REJECT("ipfw is a FreeBSD-specific"
"and OS X/Darwin-specific feature.");
diff --git a/src/or/config.h b/src/or/config.h
index c30164515d..02121cf95c 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -14,6 +14,10 @@
#include "testsupport.h"
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(DARWIN)
+#define KERNEL_MAY_SUPPORT_IPFW
+#endif
+
MOCK_DECL(const char*, get_dirportfrontpage, (void));
MOCK_DECL(const or_options_t *, get_options, (void));
MOCK_DECL(or_options_t *, get_options_mutable, (void));
diff --git a/src/test/test_options.c b/src/test/test_options.c
index 9458ade666..d294e607a2 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -1058,7 +1058,7 @@ test_options_validate__transproxy(void *ignored)
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
tt_int_op(ret, OP_EQ, -1);
-#if !defined(__FreeBSD_kernel__) && !defined( DARWIN )
+#ifndef KERNEL_MAY_SUPPORT_IPFW
tt_str_op(msg, OP_EQ, "ipfw is a FreeBSD-specificand OS X/Darwin-specific "
"feature.");
#else