mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Merge remote-tracking branch 'tor-github/pr/404'
This commit is contained in:
commit
698629f5a9
2 changed files with 14 additions and 0 deletions
4
changes/bug27928
Normal file
4
changes/bug27928
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
o Minor bugfixes (networking):
|
||||||
|
- Refrain from attempting socket rebinding when old
|
||||||
|
and new listeners are in different address families.
|
||||||
|
Fixes bug 27928; bugfix on 0.3.5.1-alpha.
|
|
@ -2797,7 +2797,17 @@ retry_listener_ports(smartlist_t *old_conns,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_LISTENER_REBIND
|
#ifdef ENABLE_LISTENER_REBIND
|
||||||
|
/* Rebinding may be needed if all of the following are true:
|
||||||
|
* 1) Address family is the same in old and new listeners.
|
||||||
|
* 2) Port number matches exactly (numeric value is the same).
|
||||||
|
* 3) *One* of listeners (either old one or new one) has a
|
||||||
|
* wildcard IP address (0.0.0.0 or [::]).
|
||||||
|
*
|
||||||
|
* These are the exact conditions for a first bind() syscall
|
||||||
|
* to fail with EADDRINUSE.
|
||||||
|
*/
|
||||||
const int may_need_rebind =
|
const int may_need_rebind =
|
||||||
|
tor_addr_family(&wanted->addr) == tor_addr_family(&conn->addr) &&
|
||||||
port_matches_exact && bool_neq(tor_addr_is_null(&wanted->addr),
|
port_matches_exact && bool_neq(tor_addr_is_null(&wanted->addr),
|
||||||
tor_addr_is_null(&conn->addr));
|
tor_addr_is_null(&conn->addr));
|
||||||
if (replacements && may_need_rebind) {
|
if (replacements && may_need_rebind) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue