[jcifs] Re: Failed to negotiate / Invalid payload size: 1

Michael B Allen mba2000 at ioplex.com
Tue Aug 23 22:02:08 GMT 2005


On Tue, 23 Aug 2005 19:18:35 +0000 (UTC)
Hayashi <hayashi at opus-software.com.br> wrote:
> > > I send you the log file (loglevel3 and loglevel99 - frame visible)
> > > I don't know the communication protocol,
> > > but it seems that response is broken or bad handled.
> > 
> > jcifs.smb.SmbException: 
> > jcifs.util.transport.TransportException
> > java.io.IOException: Invalid payload size: 1
> > 	at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:254)
> > 	at jcifs.smb.SmbTransport.doConnect(SmbTransport.java:274)
> > 	at jcifs.util.transport.Transport.run(Transport.java:204)
> > 	at java.lang.Thread.run(Unknown Source)
> 
> (Version: 1.2.2)
> Doing the change below corrected for me.
> 
> SmbTransport.java Line231...
> 
>             } else {
>                 if (localAddr == null) {
>                     socket = new Socket( address.getHostAddress
> (), /*139*/port );
>                 } else {
>                     socket = new Socket( address.getHostAddress
> (), /*139*/port, localAddr, localPort );
>                 }

That's it! This is a major blunder. That should indeed be 'port' instead
of '139' but port in this section will actually have a value of 445
not 139.

That happend because I copied the localAddr == null clause from the
ssn139() code. Oops.

So 1.2.2 will NOT work with port 445 at all. I'll have to release an
emergency fix.

Nice catch,
Mike


More information about the jcifs mailing list