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

Issues with ssh_channel_accept_forward() and reverse port forwarding


It appears from reading
https://api.libssh.org/stable/libssh_tutor_forwarding.html that in order to
implement reverse port forwarding one must continually call
ssh_channel_accept_forward() in order to accept any possible connections from
the remote side.  Is this correct?

It presents a couple challenges:

* It's a very inefficient method - polling vs. event driven

* It can generate a huge amount of log messages as ssh_channel_accept() logs
an error every time it is called and there is nothing to accept:

[2023/04/10 12:17:34.044502, 1] ssh_channel_accept:  No channel request of
this type from server

See also https://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=1421

So:

* If polling is indeed the only mechanism available here, libssh should not be
emitting an error in this case.  Possibly a DEBUG or TRACE level message
instead, but honestly enabling it for anything like x2goclient that does
continual polling will just swamp the logs.

* Is there a possibility of implementing a callback method to accept remote
connections?

Thanks,

 Orion

-- 
Orion Poplawski
IT Systems Manager                         720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       orion@xxxxxxxx
Boulder, CO 80301                 https://www.nwra.com/

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Archive administrator: postmaster@lists.cynapses.org