Telnet "_handle_control_chars_response" gets stuck in the infinite loop
See original GitHub issueSome of my switches sends in telnet: IAC WILL ECHO IAC WILL SUPPRESS-GO-AHEAD before login prompt. If they do not receive: IAC DO ECHO IAC DO SUPPRESS-GO-AHEAD they will repeat control characters infinitely, so “_handle_control_chars_response” gets stuck in the infinite loop. https://github.com/carlmontanari/scrapli/blob/81d7700746fa41773b93601b9c909de5e3d9c2f2/scrapli/transport/plugins/asynctelnet/transport.py#L86-L91
I’ve changed that code to:
if cmd in (DO, DONT):
# if server says do/dont we always say wont for that option
self.stdin.write(IAC + WONT + c)
elif cmd in WILL:
# if server says will we always say do for that option
self.stdin.write(IAC + DO + c)
elif cmd in WONT:
# if server says wont we always say dont for that option
self.stdin.write(IAC + DONT + c)
And it works. No more loops.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13 (7 by maintainers)
Top Results From Across the Web
BusyBox
1 fixes a case where in ash, "wait" never finishes. Bug fix release. 1.31. 1 has fixes for dc, ash (PS1 expansion fix),...
Read more >External protocols in C-Kermit
The external protocol programs themselves are unaware that they have been redirected over a TELNET connection, and so even if they would know ......
Read more >LiteBSD/ckc302.txt at master - GitHub
handle \fpattern() in the MINPUT parse loop, so it never worked. The code ... get stuck) but alarm() / signal() are not not...
Read more >ckc200.txt - Columbia University
Several complaints appeared recently about Kermit hanging or going into infinite loops, but they are not necessarily related, since one involves IKSD (which ......
Read more >Changes - LYNX
Even with this change, lynx.exe is 50% larger when using slang than with pdcurses ... to prevent infinite loop when the focus moves...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Awesome, just pushed to develop. Thanks again! Hopefully this is the last of the asynctelnet gremlins! 😁
Ok, tested your fix and looks like everything is working as expected on all the test platforms I have!
Let me know if you wanna PR or want me to just slap it in there, up to you!
Thanks for the help with this!
Carl