1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 20:12:48 -05:00

Implement `portfwd-loopback-choice'. Works on local side in Unix as

well, though it's a lot less useful since you still can't bind to
low-numbered ports of odd loopback IPs. Should work in principle for
SSH2 remote forwardings as well as local ones, but OpenSSH seems
unwilling to cooperate.

[originally from svn r2344]
This commit is contained in:
Simon Tatham
2002-12-18 11:39:25 +00:00
parent 8cb52a26e1
commit 99b870dbc6
9 changed files with 182 additions and 50 deletions

View File

@ -203,9 +203,10 @@ static int pfd_accepting(Plug p, void *sock)
/* Add a new forwarding from port -> desthost:destport
sets up a listener on the local machine on port
sets up a listener on the local machine on (srcaddr:)port
*/
char *pfd_addforward(char *desthost, int destport, int port, void *backhandle)
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
void *backhandle)
{
static struct plug_function_table fn_table = {
pfd_closing,
@ -231,7 +232,7 @@ char *pfd_addforward(char *desthost, int destport, int port, void *backhandle)
pr->waiting = NULL;
pr->backhandle = backhandle;
pr->s = s = new_listener(port, (Plug) pr, !cfg.lport_acceptall);
pr->s = s = new_listener(srcaddr, port, (Plug) pr, !cfg.lport_acceptall);
if ((err = sk_socket_error(s))) {
sfree(pr);
return err;