]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
enable and test transproxy on FreeBSD derivatives #18448
authorSteven Chamberlain <steven@pyro.eu.org>
Mon, 29 Feb 2016 14:15:20 +0000 (14:15 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 Mar 2016 15:01:25 +0000 (10:01 -0500)
The transproxy feature is only enabled when __FreeBSD__ is defined, and
only regular FreeBSD does that.  Change this to __FreeBSD_kernel__ which
is defined on derivatives as well.

This enables the relevant options/validate__transproxy test on FreeBSD
derivatives.

src/or/config.c
src/test/test_options.c

index 544b032f3ae353b09cc70d7e7f352cc0f92f8dca..ad4138a3cad48db9864d767897a58cc09842d209 100644 (file)
@@ -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__) && !defined( DARWIN )
+#if !defined(__FreeBSD_kernel__) && !defined( DARWIN )
       /* Earlier versions of OS X have ipfw */
       REJECT("ipfw is a FreeBSD-specific"
              "and OS X/Darwin-specific feature.");
index ff1eb1855e3de12031faf10237556b7d7cce744a..9458ade666679a21adbf385ef542852aa1d380b0 100644 (file)
@@ -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__) && !defined( DARWIN )
+#if !defined(__FreeBSD_kernel__) && !defined( DARWIN )
   tt_str_op(msg, OP_EQ, "ipfw is a FreeBSD-specificand OS X/Darwin-specific "
             "feature.");
 #else
@@ -1086,7 +1086,7 @@ test_options_validate__transproxy(void *ignored)
   tt_int_op(ret, OP_EQ, -1);
   tt_assert(!msg);
 #endif
-#if defined(__FreeBSD__) || defined( DARWIN )
+#if defined(__FreeBSD_kernel__) || defined( DARWIN )
   tdata = get_options_test_data("TransProxyType ipfw\n"
                                 "TransPort 127.0.0.1:123\n");
   ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);