Merge branch 'maint-0.2.9' into release-0.2.9

This commit is contained in:
Nick Mathewson 2016-12-08 07:49:44 -05:00
commit 669d79d2d6
3 changed files with 17 additions and 7 deletions

4
changes/bug19960 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes (netbsd, unit tests):
- Stop expecting NetBSD unit tests to report success for ipfw;
on NetBSD, it's only pf that's supported.
Part of a fix for bug 19960; bugfix on 0.2.9.5-alpha.

View File

@ -3004,7 +3004,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
} else if (!strcasecmp(options->TransProxyType, "ipfw")) { } else if (!strcasecmp(options->TransProxyType, "ipfw")) {
#ifndef KERNEL_MAY_SUPPORT_IPFW #ifndef KERNEL_MAY_SUPPORT_IPFW
/* Earlier versions of OS X have ipfw */ /* Earlier versions of OS X have ipfw */
REJECT("ipfw is a FreeBSD-specific" REJECT("ipfw is a FreeBSD-specific "
"and OS X/Darwin-specific feature."); "and OS X/Darwin-specific feature.");
#else #else
options->TransProxyType_parsed = TPT_IPFW; options->TransProxyType_parsed = TPT_IPFW;

View File

@ -1050,7 +1050,7 @@ test_options_validate__transproxy(void *ignored)
tt_int_op(ret, OP_EQ, -1); tt_int_op(ret, OP_EQ, -1);
#ifndef KERNEL_MAY_SUPPORT_IPFW #ifndef KERNEL_MAY_SUPPORT_IPFW
tt_str_op(msg, OP_EQ, "ipfw is a FreeBSD-specificand OS X/Darwin-specific " tt_str_op(msg, OP_EQ, "ipfw is a FreeBSD-specific and OS X/Darwin-specific "
"feature."); "feature.");
#else #else
tt_int_op(tdata->opt->TransProxyType_parsed, OP_EQ, TPT_IPFW); tt_int_op(tdata->opt->TransProxyType_parsed, OP_EQ, TPT_IPFW);
@ -1071,7 +1071,7 @@ test_options_validate__transproxy(void *ignored)
free_options_test_data(tdata); free_options_test_data(tdata);
tdata = NULL; tdata = NULL;
#if defined(linux) #if defined(__linux__)
tdata = get_options_test_data("TransProxyType tproxy\n" tdata = get_options_test_data("TransProxyType tproxy\n"
"TransPort 127.0.0.1:123\n"); "TransPort 127.0.0.1:123\n");
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg); ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
@ -1079,8 +1079,7 @@ test_options_validate__transproxy(void *ignored)
if (msg) { if (msg) {
TT_DIE(("Expected NULL but got '%s'", msg)); TT_DIE(("Expected NULL but got '%s'", msg));
} }
#endif #elif defined(KERNEL_MAY_SUPPORT_IPFW)
#if defined(__FreeBSD_kernel__) || defined( DARWIN ) || defined(__NetBSD__)
tdata = get_options_test_data("TransProxyType ipfw\n" tdata = get_options_test_data("TransProxyType ipfw\n"
"TransPort 127.0.0.1:123\n"); "TransPort 127.0.0.1:123\n");
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg); ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
@ -1088,8 +1087,7 @@ test_options_validate__transproxy(void *ignored)
if (msg) { if (msg) {
TT_DIE(("Expected NULL but got '%s'", msg)); TT_DIE(("Expected NULL but got '%s'", msg));
} }
#endif #elif defined(__OpenBSD__)
#if defined(__OpenBSD__)
tdata = get_options_test_data("TransProxyType pf-divert\n" tdata = get_options_test_data("TransProxyType pf-divert\n"
"TransPort 127.0.0.1:123\n"); "TransPort 127.0.0.1:123\n");
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg); ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
@ -1097,6 +1095,14 @@ test_options_validate__transproxy(void *ignored)
if (msg) { if (msg) {
TT_DIE(("Expected NULL but got '%s'", msg)); TT_DIE(("Expected NULL but got '%s'", msg));
} }
#elif defined(__NetBSD__)
tdata = get_options_test_data("TransProxyType default\n"
"TransPort 127.0.0.1:123\n");
ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
tt_int_op(ret, OP_EQ, -1);
if (msg) {
TT_DIE(("Expected NULL but got '%s'", msg));
}
#endif #endif
// Assert that a test has run for some TransProxyType // Assert that a test has run for some TransProxyType