aboutsummaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-06-29 19:32:34 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2012-09-05 18:23:28 +0300
commit44fe717524408d247ab10e3794438232d81d66dc (patch)
tree51c23d566b2812aeeac0e24bfad88fecfa8d7159 /src/tools
parent443260ffd8370c0fddefad42479b957132e8d275 (diff)
downloadtor-44fe717524408d247ab10e3794438232d81d66dc.tar
tor-44fe717524408d247ab10e3794438232d81d66dc.tar.gz
General tweaks and fixes for Nick's comments.
* Add changes/ files. * Edit the tor-fw-helper manpage. * Fix check-spaces. * Add prototype for get_list_of_ports_to_forward(). * Fix tor_parse_long() TCP port range. * Improve doc. of tor_check_port_forwarding(). * Check for overflows in tor_check_port_forwarding(). * Demote successful port forwarding to LOG_INFO. Conflicts: src/common/address.c src/or/circuitbuild.c
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tor-fw-helper/tor-fw-helper.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/tools/tor-fw-helper/tor-fw-helper.c b/src/tools/tor-fw-helper/tor-fw-helper.c
index 32633542c..d02b75791 100644
--- a/src/tools/tor-fw-helper/tor-fw-helper.c
+++ b/src/tools/tor-fw-helper/tor-fw-helper.c
@@ -249,10 +249,11 @@ tor_fw_add_ports(tor_fw_options_t *tor_fw_options,
(const char *) backends->backend_ops[i].name);
}
- r = backends->backend_ops[i].add_tcp_mapping(port_to_forward->internal_port,
- port_to_forward->external_port,
- tor_fw_options->verbose,
- backends->backend_state[i]);
+ r =
+ backends->backend_ops[i].add_tcp_mapping(port_to_forward->internal_port,
+ port_to_forward->external_port,
+ tor_fw_options->verbose,
+ backends->backend_state[i]);
if (r == 0) { /* backend success */
tor_fw_helper_report_port_fw_success(port_to_forward->internal_port,
port_to_forward->external_port,
@@ -326,13 +327,13 @@ parse_port(const char *arg)
goto err;
port_str = smartlist_get(sl, 0); /* macroify ? */
- port = (int)tor_parse_long(port_str, 10, 1, 65536, &ok, NULL);
+ port = (int)tor_parse_long(port_str, 10, 1, 65535, &ok, NULL);
if (!ok && strlen(port_str)) /* ":1555" is valid */
goto err;
port_to_forward->external_port = port;
port_str = smartlist_get(sl, 1);
- port = (int)tor_parse_long(port_str, 10, 1, 65536, &ok, NULL);
+ port = (int)tor_parse_long(port_str, 10, 1, 65535, &ok, NULL);
if (!ok)
goto err;
port_to_forward->internal_port = port;
@@ -507,3 +508,4 @@ main(int argc, char **argv)
exit(r);
}
+