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

Re: TCP/IP Port Forwarding + Patch


I would ask that the documentation be updated. I suggest writing the text,
and then Andreas might consider adding/replacing it.

Dustin
On Jan 11, 2014 6:10 AM, "Oleksandr Shneyder" <o.shneyder@xxxxxxxxxxxxx>
wrote:

> Hello Andreas,
> patch generated by "git format-patch -M origin/master" is attached.
>
> regards,
> Alex
>
> Am 10.01.2014 19:54, schrieb Andreas Schneider:
> > On Friday 10 January 2014 17:50:24 Oleksandr Shneyder wrote:
> >> Hello,
> >> here is a patch to fix problem with port forwarding.
> >
> > Hi,
> >
> > that's great. Thank you very much for your contribution.
> >
> > Could you create a patch for master and send a git format-patch?
> >
> > It is described under "Public Large Project" here:
> >
> > http://www.git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project
> >
> >
> > Please name the function ssh_channel_accept_forward()
> >
> >
> > Thanks!
> >
> >> Problem description:
> >>
> >> //forward port 9080
> >> ssh_forward_listen(session, NULL, 9080, NULL);
> >> //forward port 9090
> >> ssh_forward_listen(session, NULL, 9090, NULL);
> >> //accept connections
> >> while(1){
> >> ssh_channel channel = ssh_forward_accept(session, 1000);
> >> //channel created, but we don't know if it from port 9080 or 9090 !!!
> >> }
> >>
> >> Solution - use function, that return destination port (see patch)
> >>
> >> //forward port 9080
> >> ssh_forward_listen(session, NULL, 9080, NULL);
> >> //forward port 9090
> >> ssh_forward_listen(session, NULL, 9090, NULL);
> >> //accept connections
> >> while(1){
> >> int port;
> >> ssh_channel channel = ssh_forward_accept_ex(session, 1000, &port);
> >> fprintf(stderr, "forwarding channel from port %d\n", port);
> >> }
> >>
> >> As we need multiply port forwarding in our project (X2Go), please accept
> >> my patch or suggest your own solution to solve this problem. We will
> >> take care about patching old versions of libssh used by Debian and
> >> possible other Linux distributions.
> >>
> >> regards,
> >> Alex
> >
>
>
> --
> ----------------------------------------------------
> Oleksandr Shneyder  | Email: o.shneyder@xxxxxxxxxxxxx
> phoca GmbH          | Tel. : 0911 - 14870374 0
> Bräuhausgasse 9     | Fax. : 0911 - 14870374 9
> D-82205 Gilching    | Mobil: 0163 - 49 64 461
>
> Geschäftsführung:
> Dipl.-Inf. Oleksandr Shneyder
>
> Amtsgericht München | http://www.phoca-gmbh.de
> HRB 196 658         | http://www.x2go.org
> USt-IdNr.: DE281977973
> ----------------------------------------------------
>
>

Follow-Ups:
Re: TCP/IP Port Forwarding + PatchAndreas Schneider <asn@xxxxxxxxxxxxxx>
References:
TCP/IP Port Forwarding + PatchOleksandr Shneyder <o.shneyder@xxxxxxxxxxxxx>
Re: TCP/IP Port Forwarding + PatchAndreas Schneider <asn@xxxxxxxxxxxxxx>
Re: TCP/IP Port Forwarding + PatchOleksandr Shneyder <o.shneyder@xxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org