Skip to content

Commit

Permalink
Merge branch 'piso77-master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kd8bny committed Aug 9, 2020
2 parents 786432d + cde3f5a commit fa37b69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ int setup_tcp() {
fs = get_fs();
set_fs(KERNEL_DS);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
sock_set_reuseaddr(control->sk);
#else
opt = 1;

r = kernel_setsockopt(control, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof (opt));
if (r < 0) {
DBG("Error setting socket options");
return r;
}
#endif

set_fs(fs);

Expand Down

0 comments on commit fa37b69

Please sign in to comment.