mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 18:07:59 +00:00
Fix handling of duplicate port forwardings; they were effectively cancelling
out, but are now just ignored. (We should make more effort to prevent duplicates before they get as far as ssh_setup_portfwd() -- it's currently trivially easy to enter them in the GUI and on the command line, let alone both -- but there's bound to be someone with a saved session containing dupes out there by now, and anyway there are duplicates we can't detect before getting this far, for instance "1234:localhost:22" vs "1234:localhost:ssh".) [originally from svn r8623]
This commit is contained in:
parent
fdfac5d162
commit
c90f047476
13
ssh.c
13
ssh.c
@ -4427,12 +4427,19 @@ static void ssh_setup_portfwd(Ssh ssh, const Config *cfg)
|
|||||||
|
|
||||||
epfrec = add234(ssh->portfwds, pfrec);
|
epfrec = add234(ssh->portfwds, pfrec);
|
||||||
if (epfrec != pfrec) {
|
if (epfrec != pfrec) {
|
||||||
|
if (epfrec->status == DESTROY) {
|
||||||
/*
|
/*
|
||||||
* We already have a port forwarding with precisely
|
* We already have a port forwarding up and running
|
||||||
* these parameters. Hence, no need to do anything;
|
* with precisely these parameters. Hence, no need
|
||||||
* simply tag the existing one as KEEP.
|
* to do anything; simply re-tag the existing one
|
||||||
|
* as KEEP.
|
||||||
*/
|
*/
|
||||||
epfrec->status = KEEP;
|
epfrec->status = KEEP;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Anything else indicates that there was a duplicate
|
||||||
|
* in our input, which we'll silently ignore.
|
||||||
|
*/
|
||||||
free_portfwd(pfrec);
|
free_portfwd(pfrec);
|
||||||
} else {
|
} else {
|
||||||
pfrec->status = CREATE;
|
pfrec->status = CREATE;
|
||||||
|
Loading…
Reference in New Issue
Block a user