]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add changes file for 18448; refactor
authorNick Mathewson <nickm@torproject.org>
Fri, 11 Mar 2016 15:05:28 +0000 (10:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 Mar 2016 15:05:28 +0000 (10:05 -0500)
(I've made it so FreeBSD || FreeBSD_kernel is enough to ensure that
we think you might have ipfw, and so that the logic is all in one
place.)

changes/bug18448 [new file with mode: 0644]
src/or/config.c
src/or/config.h
src/test/test_options.c

diff --git a/changes/bug18448 b/changes/bug18448
new file mode 100644 (file)
index 0000000..e328ce3
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor features (build):
+    - Detect systems with FreeBSD-derived kernels (such as GNU/kFreeBSD) as
+      having possible IPfW support. Closes ticket 18448. Patch from
+      Steven Chamberlain.
+
+
index ad4138a3cad48db9864d767897a58cc09842d209..4f4b9dfbfd14c63b8d51299952a0588531b622a0 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_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.");
index c30164515d21ba5edf35e260dbed82cdfc3708a2..02121cf95c79485895bb66f537414463e761359d 100644 (file)
 
 #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));
index 9458ade666679a21adbf385ef542852aa1d380b0..d294e607a24a6f777e5dbebe2e82893638b84cfa 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_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