]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - portfwd.c
Implement `portfwd-loopback-choice'. Works on local side in Unix as
[PuTTY.git] / portfwd.c
index 16f001ab26dcba7be9aa3817adc82b9f0097defc..dd8e65506443472c9035c6d3d0b1f427943801aa 100644 (file)
--- a/portfwd.c
+++ b/portfwd.c
@@ -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;