Bugzilla – Attachment 3030 Details for
Bug 2756
sshd does not seem to terminate despite ClientAlive[Interval|CountMax] when a process is polling a remote forwarding channel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
keep track of the last time we heard from the client and trigger client_alive_check()
openssh-keepalive-portfwd.patch (text/plain), 1.26 KB, created by
Darren Tucker
on 2017-08-10 16:27:12 AEST
(
hide
)
Description:
keep track of the last time we heard from the client and trigger client_alive_check()
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2017-08-10 16:27:12 AEST
Size:
1.26 KB
patch
obsolete
>Index: serverloop.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/serverloop.c,v >retrieving revision 1.193 >diff -u -p -r1.193 serverloop.c >--- serverloop.c 31 May 2017 07:00:13 -0000 1.193 >+++ serverloop.c 10 Aug 2017 06:20:37 -0000 >@@ -196,8 +196,9 @@ wait_until_can_do_something(int connecti > { > struct timeval tv, *tvp; > int ret; >- time_t minwait_secs = 0; >+ time_t minwait_secs = 0, now; > int client_alive_scheduled = 0; >+ static time_t last_client_time; > > /* Allocate and update select() masks for channel descriptors. */ > channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, >@@ -262,8 +263,17 @@ wait_until_can_do_something(int connecti > memset(*writesetp, 0, *nallocp); > if (errno != EINTR) > error("select: %.100s", strerror(errno)); >- } else if (ret == 0 && client_alive_scheduled) >- client_alive_check(); >+ } else if (client_alive_scheduled) { >+ if (ret == 0) { /* timeout */ >+ client_alive_check(); >+ } else if (FD_ISSET(connection_in, *readsetp)) { >+ last_client_time = monotime(); >+ } else if (last_client_time != 0 && last_client_time + >+ options.client_alive_interval < (now = monotime())) { >+ client_alive_check(); >+ last_client_time = now; >+ } >+ } > > notify_done(*readsetp); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2756
:
3029
| 3030