mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-28 07:14:48 -05:00
Allow remote-to-local forwardings to use IPv6.
RFC 4245 section 7.1 specifies the meaning of the "address to bind" parameter in a "tcpip-forward" request. "0.0.0.0" and "127.0.0.1" are specified to be all interfaces and the loopback interface respectively in IPv4, while "" and "localhost" are the address-family-agnostic equivalents. Switch PuTTY to using the latter, since it doesn't seem right to force IPv4. There's an argument that PuTTY should provide a means of configuring the address family used for remote forwardings like it does for local ones. [originally from svn r9668]
This commit is contained in:
parent
d5836982e2
commit
bc8f2193f6
8
ssh.c
8
ssh.c
@ -4618,9 +4618,9 @@ static void ssh_setup_portfwd(Ssh ssh, Conf *conf)
|
||||
/* XXX: rport_acceptall may not represent
|
||||
* what was used to open the original connection,
|
||||
* since it's reconfigurable. */
|
||||
ssh2_pkt_addstring(pktout, "0.0.0.0");
|
||||
ssh2_pkt_addstring(pktout, "");
|
||||
} else {
|
||||
ssh2_pkt_addstring(pktout, "127.0.0.1");
|
||||
ssh2_pkt_addstring(pktout, "localhost");
|
||||
}
|
||||
ssh2_pkt_adduint32(pktout, epf->sport);
|
||||
ssh2_pkt_send(ssh, pktout);
|
||||
@ -4733,9 +4733,9 @@ static void ssh_setup_portfwd(Ssh ssh, Conf *conf)
|
||||
if (epf->saddr) {
|
||||
ssh2_pkt_addstring(pktout, epf->saddr);
|
||||
} else if (conf_get_int(conf, CONF_rport_acceptall)) {
|
||||
ssh2_pkt_addstring(pktout, "0.0.0.0");
|
||||
ssh2_pkt_addstring(pktout, "");
|
||||
} else {
|
||||
ssh2_pkt_addstring(pktout, "127.0.0.1");
|
||||
ssh2_pkt_addstring(pktout, "localhost");
|
||||
}
|
||||
ssh2_pkt_adduint32(pktout, epf->sport);
|
||||
ssh2_pkt_send(ssh, pktout);
|
||||
|
Loading…
x
Reference in New Issue
Block a user