Repository navigation
Fixes on the telnet rewrite - #71
Merged
Merged
Conversation
jonrebm
force-pushed
the
telnet_seq
branch
2 times, most recently
from
October 12, 2026 15:09
bc2475d to
0ede3e2
Compare
Member
|
Seems to fix rfc2218 connections where microcom exitted earlier with |
memchr() may be type-generic returning const if the supplied ptr argument is const, resulting in a discarded-qualifiers warning. Silence it by keeping the const qualifier. Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Add some more test cases, most noticeably cover DO and WILL sequences. Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
jonrebm
force-pushed
the
telnet_seq
branch
2 times, most recently
from
October 13, 2026 12:53
25c487d to
40579a6
Compare
Contributor
Author
|
Fixed three typos and added 40579a6 |
The telnet command handling was implemented to skip one character after handling each command, which made handling IAC,IAC sequences in handle_iac() much easier but fails to handle sequences in direct succession. Allow handling a new control sequence right after one ended. To still allow handle_iac() to emit a literal IAC, introduce a new private bool in telnet_ios that signals the caller to skip the second IAC byte. Fixes: 5cf691b ("telnet.c: rewrite command handling") Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
handle_iac() consumes one byte too few at a subnegotiation, leaking the 0xf0 (Subneg End) into the output stream. Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Returning 0 from telnet_read() when none of the bytes read produced any output is interpreted as EOF. Instead, handle this case as EAGAIN to avoid "Got EOF from port" from mux_loop(). Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
As the regression test shows, an SE occurring within a subneg any place after an IAC would end the subneg, leading the regression to fail assert b'before!after' == b'beforeafter'. Conform to rfc854 by staying in the subneg until encountering IAC immediately followed by SE. Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
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.
Since the telnet rewrite in 5cf691b, issues of escape sequences wrongfully printed to the console have been reported from users of the telnet backend. This is mainly addressed by telnet.c: fix handling of successive command sequences, this PR accompanies the fix with regression tests, improvements in test coverage overall, and a few other issues in telnet.c resolved as well.