Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: rl1987/tor
base: master
head repository: rl1987/tor
compare: bug17873_take3_squashed
Checking mergeability… Don’t worry, you can still create the pull request.
Showing with 274 additions and 82 deletions.
  1. +6 −0 changes/bug17873
  2. +1 −15 src/or/config.c
  3. +180 −64 src/or/connection.c
  4. +12 −2 src/or/connection.h
  5. +1 −1 src/or/main.c
  6. +3 −0 src/test/include.am
  7. +64 −0 src/test/test_rebind.py
  8. +7 −0 src/test/test_rebind.sh
@@ -0,0 +1,6 @@
o Minor bugfixes (OS compatibility):
- On Linux and Windows properly handle configuration change that
moves a listener to/from wildcard IP address. In case first
attempt to bind a socket fails, close the old listener and
try binding a socket again. Fixes bug 17873; bugfix on
0.0.8pre-1.
@@ -1362,7 +1362,6 @@ static int
options_act_reversible(const or_options_t *old_options, char **msg)
{
smartlist_t *new_listeners = smartlist_new();
smartlist_t *replaced_listeners = smartlist_new();
or_options_t *options = get_options_mutable();
int running_tor = options->command == CMD_RUN_TOR;
int set_conn_limit = 0;
@@ -1446,8 +1445,7 @@ options_act_reversible(const or_options_t *old_options, char **msg)
* networking is disabled, this will close all but the control listeners,
* but disable those. */
if (!we_are_hibernating()) {
if (retry_all_listeners(replaced_listeners, new_listeners,
options->DisableNetwork) < 0) {
if (retry_all_listeners(new_listeners, options->DisableNetwork) < 0) {
*msg = tor_strdup("Failed to bind one of the listener ports.");
goto rollback;
}
@@ -1582,17 +1580,6 @@ options_act_reversible(const or_options_t *old_options, char **msg)
"Overwrite the log afterwards.", badness);
}

SMARTLIST_FOREACH(replaced_listeners, connection_t *, conn,
{
int marked = conn->marked_for_close;
log_notice(LD_NET, "Closing old %s on %s:%d",
conn_type_to_string(conn->type), conn->address, conn->port);
connection_close_immediate(conn);
if (!marked) {
connection_mark_for_close(conn);
}
});

if (set_conn_limit) {
/*
* If we adjusted the conn limit, recompute the OOS threshold too
@@ -1646,7 +1633,6 @@ options_act_reversible(const or_options_t *old_options, char **msg)

done:
smartlist_free(new_listeners);
smartlist_free(replaced_listeners);
return r;
}

No commit comments for this range