Conversation
A segfault in a server child process wouldn't have been detected. This detection is simple but seems adequate.
This has no functional effect, but improves the innacurate comment on the Listener "type" field.
There are three bugs involved here. get_listener() only tested the first element in the list rather than iterating. This was incorrect when first written in 444dbb5 ("- Reworked non-channel fd handling to listener.c - More channel cleaning up") tcpinfo.chantype isn't initialised in svr_cancelremotetcp(), so matchtcp() never succeeded. The chantype comparison is unnecessary (LISTENER_TYPE_TCPFORWARDED has already been checked), so remove it. matchtcp() was comparing with listenaddr, but that will be NULL when listening on localhost, logic in svr_remotetcpreq(). That regressed in 1984aab ("Server shouldn't return "localhost" in response to -R forward connections if that wasn't what the client requested.") The NULL pointer previously couldn't be reached due to the chantype problem mentioned above. A testcase is added. Fixes #412, fixes #413
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 are three bugs involved here.
get_listener() only tested the first element in the list rather than
iterating. This was incorrect when first written in
444dbb5 ("- Reworked non-channel fd handling to listener.c - More channel cleaning up")
tcpinfo.chantype isn't initialised in svr_cancelremotetcp(), so
matchtcp() never succeeded. The chantype comparison is unnecessary
(LISTENER_TYPE_TCPFORWARDED has already been checked), so remove it.
matchtcp() was comparing with listenaddr, but that will be NULL
when listening on localhost, logic in svr_remotetcpreq().
This codepath previously couldn't be reached due to the chantype test.
That regressed in 1984aab ("Server shouldn't return "localhost" in response to -R forward connections if that wasn't what the client requested.")
A testcase is added.
Fixes #412, fixes #413