Hacking source: un-forward local port?

Konstantin Leonov edk at caribbeanblue.ru
Thu Feb 4 06:12:58 EST 2010


Hello!

I was looking around for a solution which would allow me to un-forward
already locally forwarded port but had no luck.

So I decided to try and add it myself.
I am not a good C coder, in fact, I've never really coded under unix
before(it's just half a year since I fully moved from windowz). Here
is what I made by now:
http://www.linuxquestions.org/questions/programming-9/c-coding-hacking-ssh-dynamic-local-port-forwarding-implementation-786608/
By querying ~C and "-KL<port>" now it is possible to remove local
listener and later, reuse it to forward to another destination.
I didn't test it with specifying bind address, and I guess that will
probably fail anyways since I've only one input param in newly created
function.

If this hack can be of any help and developed further, to be added in
OpenSSH later: that would be great! In fact I just had nothing to do
and some guy on forum posted that question about impossibility of
removing local port forward in openssh so I took some time and tried
to hack sources to implement that myself, just my curiosity.
Maybe if I'll wish, I'll get back to this later and see if I can
improve it and make it not as ugly hack as it is now :)

Anyway, can someone explain me why such an easy thingy has not been
fully implemented recently? Noone ever asked? Noone ever thought? Or
it was me who searched not good enough? Anyways it is neither in
stable nor in SVN releases. Dynamic un-forwarding works great in
PuTTY, for instance.

Konstantin.


More information about the openssh-unix-dev mailing list