diff options
author | Roger Dingledine <arma@torproject.org> | 2007-11-30 07:49:49 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-11-30 07:49:49 +0000 |
commit | 9df8eec60e8daa87b87b2cae3d55cede4b2081db (patch) | |
tree | a4f547cc8971dd8e18d33d658c6d03fda9597789 /src/or/policies.c | |
parent | d9ad41767bf60f4ccae4bb8ed0dd1df40eed8054 (diff) | |
download | tor-9df8eec60e8daa87b87b2cae3d55cede4b2081db.tar.gz tor-9df8eec60e8daa87b87b2cae3d55cede4b2081db.zip |
backport r12459
svn:r12611
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index 3129ea35f7..53b3f2bfaf 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -232,7 +232,7 @@ validate_addr_policies(or_options_t *options, char **msg) *msg = NULL; if (policies_parse_exit_policy(options->ExitPolicy, &addr_policy, - options->ExitPolicyRejectPrivate)) + options->ExitPolicyRejectPrivate, NULL)) REJECT("Error in ExitPolicy entry."); /* The rest of these calls *append* to addr_policy. So don't actually @@ -554,10 +554,16 @@ exit_policy_remove_redundancies(addr_policy_t **dest) */ int policies_parse_exit_policy(config_line_t *cfg, addr_policy_t **dest, - int rejectprivate) + int rejectprivate, const char *local_address) { - if (rejectprivate) + if (rejectprivate) { append_exit_policy_string(dest, "reject private:*"); + if (local_address) { + char buf[POLICY_BUF_LEN]; + tor_snprintf(buf, sizeof(buf), "reject %s:*", local_address); + append_exit_policy_string(dest, buf); + } + } if (parse_addr_policy(cfg, dest, -1)) return -1; append_exit_policy_string(dest, DEFAULT_EXIT_POLICY); |