Subject: | Bug in Packet.pm |
Date: | Fri, 7 Oct 2016 19:43:05 +0000 |
To: | "bug-Net-SSH-Perl [...] rt.cpan.org" <bug-Net-SSH-Perl [...] rt.cpan.org> |
From: | "Votava, Craig (Nokia - US)" <craig.votava [...] nokia.com> |
Folks-
More and more you will start seeing this error message when trying to connect to upgraded ssh hosts via Net::SSH::Perl:
XS_Tk__Callback_Call error:Protocol error: expected packet type 91, got 80 at /opt/exp/perl/perl5.8/lib/site_perl/5.8.8/Net/SSH/Perl/Packet.pm line 222
This is due to some new changes made in the updated sshd servers.
I needed to fix this quickly, and documented my debugging & workaround here:
http://www.perlmonks.org/?node_id=1144748
Basically, I ended up changing the following code (in Red):
.../Net/SSH/Perl/Packet.pm:
217 sub read_expect {
218 my $class = shift;
219 my($ssh, $type) = @_;
220 my $pack = $class->read($ssh);
221 while($pack->type == 80) { # CMV Hack start vvvv
222 print STDERR "IGNORING GLOBAL MESSAGE...";
223 $pack = $class->read($ssh);
224 print STDERR " NEXT MESSAGE IS: ", $pack->type, "\n";
225 } # CMV Hack end ^^^^
226 if ($pack->type != $type) {
227 $ssh->fatal_disconnect(sprintf
228 "Protocol error: expected packet type %d, got %d",
229 $type, $pack->type);
230 }
231 $pack;
232 }
I wanted to announce this to the list, and see if anybody has a better workaround.
If not, can we get this in the distribution?
Thanks
-Craig