Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Core
Tor
Commits
698629f5
Commit
698629f5
authored
Oct 16, 2018
by
Nick Mathewson
🐛
Browse files
Merge remote-tracking branch 'tor-github/pr/404'
parents
8a0b7414
89c4a3a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
changes/bug27928
0 → 100644
View file @
698629f5
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.
src/core/mainloop/connection.c
View file @
698629f5
...
...
@@ -2797,7 +2797,17 @@ retry_listener_ports(smartlist_t *old_conns,
break
;
}
#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
=
tor_addr_family
(
&
wanted
->
addr
)
==
tor_addr_family
(
&
conn
->
addr
)
&&
port_matches_exact
&&
bool_neq
(
tor_addr_is_null
(
&
wanted
->
addr
),
tor_addr_is_null
(
&
conn
->
addr
));
if
(
replacements
&&
may_need_rebind
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment