nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
10.05k stars 1.3k forks source link

Change TCPServer backlog to 1 #2785

Closed Lex-ari closed 3 months ago

Lex-ari commented 3 months ago
Related Issue(s) #2603
Has Unit Tests (y/n) n
Documentation Included (y/n) n

Change Description

Change TCP backlog to 1 from 0 in TcpServerSocket.cpp

Rationale

Some Linux kernels would accept 0 as a backlog size, which would drop all incoming TCP SYN connections and prevent anything from connecting to FSW. Changing the backlog will allow SYN packets to be accepted. This issue may have been the cause of #2603 (I am using the exact same hardware).

Huge props to @Joshua-Anderson and @kevin-f-ortega for helping and finding this fix!

Testing/Review Recommendations

Hardware: Nvidia Jetson Nano 2GB, Ubuntu 18.04, Jetson Linux 4.9.337-tegra R32.7.4 Project and deployment build for aarch64 and running FSW and GDS, verified TCP connection. May also use other web / Linux tools to connect to the IP and port, with corresponding accept message.

LeStarch commented 3 months ago

Am I to interpret this PR to mean that some Linux kernel implementations interpret 0 to mean "deny all incoming connections"?

Joshua-Anderson commented 3 months ago

Am I to interpret this PR to mean that some Linux kernel implementations interpret 0 to mean "deny all incoming connections"?

Yup - exactly! Just don't ask how many hours of TCP debugging it took for us figure it out

LeStarch commented 3 months ago

Reading around, it seems 0 means "use some minimum" and this value may be a "hint" anyway. Thus this change should not cause harm. I'd like to know the answer to my question, but it is not blocking.