You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/08/31 20:57:00 UTC

[jira] [Work logged] (SSHD-1293) ExplicitPortForwardingTracker does not unbind auto-allocated one

     [ https://issues.apache.org/jira/browse/SSHD-1293?focusedWorklogId=805365&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-805365 ]

ASF GitHub Bot logged work on SSHD-1293:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Aug/22 20:56
            Start Date: 31/Aug/22 20:56
    Worklog Time Spent: 10m 
      Work Description: knalli opened a new pull request, #241:
URL: https://github.com/apache/mina-sshd/pull/241

   This fixes de-allocating / unbinding a local port forwarding binding when using a dynamic auto-allocated port.
   
   The information "localAddress" is controlled by the user and may contain still a port `0` which means auto-allocating a local port; the actual local port is available in 'boundAddress". However, "DefaultForwarder" tracks
   the actual port mappings only.
   
   I have run the tests locally with a Java 8 without issues.
   
   Related issue https://issues.apache.org/jira/browse/SSHD-1293
   
   I also added an additional commit modifying the test covering the missing signal. If you are fine with this, I'd squash them. Or maybe as an additional test?




Issue Time Tracking
-------------------

            Worklog Id:     (was: 805365)
    Remaining Estimate: 0h
            Time Spent: 10m

> ExplicitPortForwardingTracker does not unbind auto-allocated one
> ----------------------------------------------------------------
>
>                 Key: SSHD-1293
>                 URL: https://issues.apache.org/jira/browse/SSHD-1293
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.8.0
>            Reporter: Jan Philipp
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I have noticed that the de-allocation (unbind of a forwarding) initiated by {{org.apache.sshd.client.session.forward.ExplicitPortForwardingTracker}} in the {{close()}} method will not no close the actual forwarding. Said that, this leaves the connection and a file handler open.
> The actual main reason is that it uses \{{manager.stopLocalPortForwarding(this.getLocalAddress());}} which means it stops the tunnel identified the "local address" which is the same as provided by the user. If the user is using a local address with port {{0}} (which seems legit since the docs state this explicitly), the local address will be still something like {{0.0.0.0:0}} or maybe {{{}127.0.0.1:0{}}}, but only the "bound address" contains the actual dynamic auto-allocated port.
> If the user uses an explicit port, this would work.
> As a workaround, I have added after {{tracker.close()}} an explicit {{session.stopLocalPortForwarding(tracker.getBoundAddress())}}. I don't know if this would your final solution or this would be an issue in \{{DefaultForwarder#stopLocalPortForwarding}}.
>  
> I'm using 2.8 right now; as far as I can see there are no changes in 2.9 regarding this.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org