Keepalive timeout with dropbear client

David Chapdelaine dchapdelaine at GENETEC.COM
Tue Jun 7 19:59:03 AWST 2016


Hi everyone,

We have been using version 65 of Dropbear to maintain an ssh connection to a central server. It usually works fine, but when there is a network failure the Dropbear client waits until there is a tcp timeout before declaring that there was a keepalive timeout. So in practice even though we set the keepalive timeout as 30 seconds, dbclient doesn't exit before ~15 minutes which is when the tcp timeout is triggered.

By digging in dropbear's code I noticed that when running in client mode, the connection to the server is blocking whereas that connection is non blocking when running in server mode. I thus changed the connection to non blocking in client mode. To do this I changed the call to connect_remote line 75-76 of cli-main.c from

int sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, 0, &error);

to

int sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, 1, &error);

Initial tests are good so far and it addresses our issue, but I wanted to run this through you to get your insights on potential problems with this change. As far as you know, is there any side effect that we should be aware of? Was there a reason why the connection was blocking in client mode?

Thanks a lot for your inputs!

David Chapdelaine
Développeur logiciel | Software Developer
T|P: +1-514-332-4000 p.6595 | dchapdelaine at genetec.com<mailto:dchapdelaine at genetec.com>

[cid:image001.png at 01D0F159.91250450]

Conçu pour évoluer | Built to evolve | www.genetec.com/dna<http://www.genetec.com/dna>
[cid:image003.png at 01CBEA2D.0B393EC0]<http://www.facebook.com/Genetec>[cid:image004.png at 01CBEA2D.0B393EC0]<http://www.linkedin.com/company/genetec/> [cid:image005.png at 01CBEA2D.0B393EC0] <http://www.twitter.com/_Genetec_>  [cid:image006.png at 01CBEA2D.0B393EC0] <http://www.youtube.com/Genetec>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20160607/7b3eddb0/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7136 bytes
Desc: image001.png
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20160607/7b3eddb0/attachment-0005.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1344 bytes
Desc: image002.png
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20160607/7b3eddb0/attachment-0006.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1361 bytes
Desc: image003.png
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20160607/7b3eddb0/attachment-0007.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1482 bytes
Desc: image004.png
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20160607/7b3eddb0/attachment-0008.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1524 bytes
Desc: image005.png
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20160607/7b3eddb0/attachment-0009.png 


More information about the Dropbear mailing list