Bug 204593

Summary: listen(2): outdated "backlog" argument description
Product: Documentation Reporter: Michael Orlitzky (michael)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Michael Orlitzky 2019-08-15 20:08:30 UTC
The documentation for the "backlog" argument to the listen() call says...

       The  behavior of the backlog argument on TCP sockets changed with Linux
       2.2.  Now it specifies the  queue  length  for  completely  established
       sockets  waiting  to  be  accepted, instead of the number of incomplete
       connection requests.  The maximum length of the  queue  for  incomplete
       sockets  can be set using /proc/sys/net/ipv4/tcp_max_syn_backlog.  When
       syncookies are enabled there is no logical maximum length and this set‐
       ting is ignored.  See tcp(7) for more information.

However, I believe this changed with linux-4.3 in commit ef547f2ac16bd9d:

https://github.com/torvalds/linux/commit/ef547f2ac16bd9d77a780a0e7c70857e69e8f23f#diff-56ecfd3cd70d57cde321f395f0d8d743L43

Now, the test for the SYN queue is against sk_listener->sk_max_ack_backlog, which include/net/sock.h tells me is

  * @sk_max_ack_backlog: listen backlog set in listen()

In other words, I think the "backlog" argument for listen() now applies to incomplete connections as well.