|
@@ -1089,7 +1089,7 @@ options_act_reversible(const or_options_t *old_options, char **msg)
|
|
|
|
|
|
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_PFVAR_H)
|
|
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_PFVAR_H)
|
|
/* Open /dev/pf before dropping privileges. */
|
|
/* Open /dev/pf before dropping privileges. */
|
|
- if (options->TransPort_set) {
|
|
|
|
|
|
+ if (options->TransPort_set && options->TransProxyType_parsed != TPT_IPFW) {
|
|
if (get_pf_socket() < 0) {
|
|
if (get_pf_socket() < 0) {
|
|
*msg = tor_strdup("Unable to open /dev/pf for transparent proxy.");
|
|
*msg = tor_strdup("Unable to open /dev/pf for transparent proxy.");
|
|
goto rollback;
|
|
goto rollback;
|
|
@@ -2558,6 +2558,12 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
|
REJECT("TPROXY is a Linux-specific feature.");
|
|
REJECT("TPROXY is a Linux-specific feature.");
|
|
#else
|
|
#else
|
|
options->TransProxyType_parsed = TPT_TPROXY;
|
|
options->TransProxyType_parsed = TPT_TPROXY;
|
|
|
|
+#endif
|
|
|
|
+ } else if (!strcasecmp(options->TransProxyType, "ipfw")) {
|
|
|
|
+#ifndef __FreeBSD__
|
|
|
|
+ REJECT("ipfw is a FreeBSD-specific feature.");
|
|
|
|
+#else
|
|
|
|
+ options->TransProxyType_parsed = TPT_IPFW;
|
|
#endif
|
|
#endif
|
|
} else {
|
|
} else {
|
|
REJECT("Unrecognized value for TransProxyType");
|
|
REJECT("Unrecognized value for TransProxyType");
|