Skip to content

Commit

Permalink
Fix "ERROR: [udp] remote_recv_bind: Address already in use" when mult…
Browse files Browse the repository at this point in the history
…iple `reuse_port`-enabled `ss-redir` instances are listening on the same address
  • Loading branch information
oakaigh authored and Max Lv committed Jan 29, 2021
1 parent cfe0c2c commit 13f4720
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/udprelay.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,11 @@ remote_recv_cb(EV_P_ ev_io *w, int revents)
close(src_fd);
goto CLEAN_UP;
}
if (reuse_port) {
if (set_reuseport(src_fd) != 0) {
ERROR("[udp] remote_recv port_reuse");
}
}
#ifdef IP_TOS
// Set QoS flag
int tos = 46 << 2;
Expand Down

0 comments on commit 13f4720

Please sign in to comment.