[ECOS] changing tcp_maxidle?
Grant Edwards
grante@visi.com
Mon Oct 22 15:25:00 GMT 2001
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
More information about the Ecos-discuss
mailing list