Transmission has issues with certain trackers - how to port Linux fix to FreeNAS?

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
Some trackers don't work with Transmission anymore because the firewalls of the trackers mistakenly assume a SYN flood attack.

This also affects the FreeNAS versions.

There is a workaround for Linux:

Code:
echo 'net.ipv4.tcp_adv_win_scale = 4' | sudo tee -a /etc/sysctl.conf; sudo sysctl -psysctl -p


which doesn't work on FreeNAS since the underlying FreeBSD doesn't support the net.ipv4.tcp_adv_win_scale conf option in the sysctl.conf file.

There is a patch for FreeBSD:

Code:
diff --git a/libtransmission/web.c b/libtransmission/web.c
index 744f5766a..aaef5b9e1 100644
--- a/libtransmission/web.c
+++ b/libtransmission/web.c
@@ -140,8 +140,8 @@ static int sockoptfunction(void* vtask, curl_socket_t fd, curlsocktype purpose U
     /* announce and scrape requests have tiny payloads. */
     if (isScrape || isAnnounce)
     {
-        int const sndbuf = isScrape ? 4096 : 1024;
-        int const rcvbuf = isScrape ? 4096 : 3072;
+        int const sndbuf = 8192;
+        int const rcvbuf = 8192;
         setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void const*)&sndbuf, sizeof(sndbuf));
         setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void const*)&rcvbuf, sizeof(rcvbuf));
     }


but it is quite annoying to install a patched version instead of the original version via plugin.

Is there a translation of the Linux sysctl.conf addition with net.ipv4.tcp_adv_win_scale to something that works with FreeNAS?
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
Thanks, I probably just try it out, also suggestions under http://slaptijack.com/system-administration/freebsd-tcp-performance-tuning/ as well.

I am hesitant because I don't know the consequences for the system for other applications. The values are also an awful lot away from the 4k or 8k in the patch or in the Linux sysctl, but I guess a little blind poking with a stick is the only way to do it...
 
D

dlavigne

Guest
In that case, test the sysctls at the command line before deciding they work well for you--at that point you can add them to Tunables.

Also, please post if you are successful so others know the FreeBSD/FreeNAS equivalent :smile:
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
So far, no luck. Maybe someone else can chime in to help? I need to define the minimum window for TCPv4 somehow. Everything I found deals with the maximum for efficient transmission under GbE or better conditions.

I can't see if the failures are due to the wrong setting or other factors, like a missing restart.
 

silverback

Contributor
Joined
Jun 26, 2016
Messages
134
I am very interested in a solution as well. Hopefully I will have time to dabble in a test environment soon.
 
Joined
Jan 18, 2017
Messages
524
is there a patched version available? I thought you had to build it yourself to change that.
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
I got a workaround which I post here to help out, but it's just going into the torrent properties and changing the tracker from <...>announce.php to <...>announce.php?scrape .

This works with the current Transmission version.
 
Joined
Jan 18, 2017
Messages
524
well I'll be damned that looks like it works
 
Top