NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/56346: Listening socket instantly closes if TCP_KEEPALIVE options are set on the server side



The following reply was made to PR kern/56346; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: szilard.parrag%gmail.com@localhost, Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: kern/56346: Listening socket instantly closes if TCP_KEEPALIVE
 options are set on the server side
Date: Mon, 2 Aug 2021 23:02:50 +0000 (UTC)

 Some observations:
 
 1. As kre@ explained, setting keepalive parameters on a listening
     socket is decidedly odd. You set them only after the connection
     is established.
 
 2. The code seems to work of you don't set TCP_KEEPINTVL.
 
 3. The code works unchanged on FreeBSD. Probably because FreeBSD
     doesn't set a TCP_KEEPIDLE timer for listening sockets. Maybe
     NetBSD should do the same in change_keepalive().
 
 4. There is a typo in tcp_usrreq.c:tcp_ctloutput() (-HEAD & 9.x):
 
     case PRCO_GETOPT:
     ...
             case TCP_KEEPINIT:
             optval = tp->t_keepcnt;
 
    That should be `t_keepinit'. Someone please fix this.
 
 -RVP
 


Home | Main Index | Thread Index | Old Index