TCP reset on remote connection failure#538
Open
liojacqs wants to merge 2 commits intojpillora:masterfrom
Open
Conversation
Will prevent the input proxy to send anything on SSH if it's not possible to connect to the remote end. If the TCP connection fails, SSH connection attempt is rejected with reason ConnectionFailed, and and the TCP connection error message.
On remote connection failure, reset TCP connection, so the client (if well written), may be aware of an issue, even if all the data could be sent before (with TCP, data can be sent before Accept() on the server side). The reason for failure is sent back to the client.
Author
|
Hello, |
Author
|
Hello, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is currently no possibility for a "simple" TCP client (i.e sending data and not expecting any particular feedback), to know that a remote end is not actually responding, because:
This is problematic when dealing with some remote write only devices that may or may not be up and running, as chisel is "hiding" the non availability of the devices.
As the chisel listening port will always be up, it is indeed impossible to have the same behaviour as when dealing directly with the device, but it is possible at some point to abruptly reset the TCP connection, so the client has a chance to catch an error.
This proposal implements the following changes for TCP connection:
Note: Resetting TCP connection requires attempting to write some data to the client, so the origin of error is used as data as well
With this change, a simple netcat to a Chisel input proxy towards a non reachable remote will now:
Example below.
Server log
Client logs
netcat