diff options
author | Roger Dingledine <arma@torproject.org> | 2004-02-18 07:23:38 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-02-18 07:23:38 +0000 |
commit | 67c0c64aa4cfa67561d4189443fe3663c8190b18 (patch) | |
tree | 968d8a6067925e898baafd6c9c1b77269a09bdba /src/or/router.c | |
parent | 4e178907abc0b9cccbd7a5fc0fd19c98d87f3eee (diff) | |
download | tor-67c0c64aa4cfa67561d4189443fe3663c8190b18.tar tor-67c0c64aa4cfa67561d4189443fe3663c8190b18.tar.gz |
go back to a single exitpolicy parameter
if your exitpolicy includes " *:*" then it is final,
else we append the default exit policy.
(thanks weasel)
svn:r1105
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index 25fc6dd73..aefa0c064 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -286,9 +286,15 @@ static void router_add_exit_policy_from_config_helper(char *s, routerinfo_t *rou } } +#define DefaultExitPolicy "reject 0.0.0.0/8,reject 169.254.0.0/16,reject 127.0.0.0/8,reject 192.168.0.0/16,reject 10.0.0.0/8,reject 172.16.0.0/12,accept *:20-22,accept *:53,accept *:79-80,accept *:110,accept *:143,accept *:443,accept *:873,accept *:993,accept *:995,accept *:1024-65535,reject *:*" + static void router_add_exit_policy_from_config(routerinfo_t *router) { - router_add_exit_policy_from_config_helper(options.ExitPolicyPrepend, router); router_add_exit_policy_from_config_helper(options.ExitPolicy, router); + if(strstr(options.ExitPolicy," *:*") == NULL) { + /* if exitpolicy includes a *:* line, then we're done. Else, append + * the default exitpolicy. */ + router_add_exit_policy_from_config_helper(DefaultExitPolicy, router); + } } /* Return false if my exit policy says to allow connection to conn. |