This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
changing tcp_maxidle?
- To: ecos-discuss at sources dot redhat dot com
- Subject: [ECOS] changing tcp_maxidle?
- From: Grant Edwards <grante at visi dot com>
- Date: Mon, 22 Oct 2001 17:27:59 -0500
Leaving aside the debate on whether TCP keepalive is
intrinsically evil or not, I find that not only do I need to
enable it, I need to control the timing parameters at runtime.
These parameters are controlled by five global variables in
tcp_timer.c:
int tcp_keepidle = TCPTV_KEEP_IDLE;
int tcp_keepintvl = TCPTV_KEEPINTVL;
int tcp_maxpersistidle = TCPTV_KEEP_IDLE; /* max idle time in persist */
int tcp_maxidle;
The first four are no problem. Since they are globally
visible, and statically initialized, my appication can modify
them as needed. However, the fifth one (tcp_maxidle) is not
initialized statically. Rather, it is initialized every 500ms
inside tcp_slowtimo():
void
tcp_slowtimo()
{
[...]
s = splsoftnet();
tcp_maxidle = TCPTV_KEEPCNT * tcp_keepintvl;
I can find no other place where tcp_maxidle is set, and it
doesn't appear that its value ever changes. Is there any
reason not to initialize tcp_maxidle statically? Something
like:
int tcp_keepidle = TCPTV_KEEP_IDLE;
int tcp_keepintvl = TCPTV_KEEPINTVL;
int tcp_maxpersistidle = TCPTV_KEEP_IDLE; /* max idle time in persist */
int tcp_maxidle = TCPTV_KEEPCNT * TCPTV_KEEPINTVL;;
That would allow me a much cleaner way to dig a hole into which
I may later fall...
--
Grant Edwards
grante@visi.com