Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateShellStream throwing "Failed to open a channel after 10 attempts" because LocalPacketSize is too big for server side #1523

Open
tnxfi opened this issue Oct 23, 2024 · 0 comments

Comments

@tnxfi
Copy link

tnxfi commented Oct 23, 2024

I ran into a problem where an old Extreme Networks switch was always giving “Connect failed: hostname, Renci.SshNet.Common.SshException: Failed to open a channel after 10 attempts” in response to an attempt to call CreateShellStream.

After some debugging I found out that in ChannelSession.cs “private void SendChannelOpenMessage()” ends up setting LocalPacketSize as 65536.
For some reason that switch seems to operate on signed ints and only allows maximum value of 32768. Anything above that and the channel creation error is guaranteed.

For my use I can setup needed correction in source, but could there be a generic way to setup the value in the creation of ShellStream?
Also this servers as FYI for anyone hitting their head against the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant