[Samba] Samba PDC problem: Please help me avoid a mutiny! :-)

Andrew Bartlett abartlet at samba.org
Sun Nov 10 09:03:01 GMT 2002


On Sun, 2002-11-10 at 17:45, Ray Simard wrote:
> Thank you very much for your reply!
> 
> On Saturday 09 November 2002 21:14, Andrew Bartlett wrote:
> >> ..
> > > The manifestation is, in nearly all cases, that the PDC sends a message
> > > to the workstation and waits for a response.
> >
> > This protocol doesn't usually work like that.  SMB is (for all cases
> > except oplocks) a client-initiated protocol - the client is always
> > waiting for the server.
> >
> > What message/reply do you think the server is waiting for?
> >
> > Andrew Bartlett
> 
> I confess that I'm not really up on the SMB/CIFS protocols (though I am learning a lot lately).
> Here's a fragment from a log which might help. I am not sure how to identify what the message to the WS is
> or what the WS is expected to do in response. I'm turning off wordwrap for readabillity.
> 
> If I get this right, this is a message being sent to the WS, after which the PDC looks for a reply. After waiting
> for about 50 seconds, Samba gets an EOF back from the WS and does timeout processing (the third
> entry from the bottom in the log fragment I quote here). The line " receive_smb: length < 0!" is a little misleading:
> read_smb_length_return_keepalive returns
> -1 whenever it fails to read exactly 4 bytes from the socket, and that's what the message in the log
> is reporting.

OK.  Some details on Samba's internal request processing:

Samba sits on a socket, and uses select() to wait until there is
activity to deal with.  Whenever there is such activity, it reads 4
bytes - the NBT header and the datagram length.

However, it could well be that the the 'activity' wasn't 'incoming
packet' but 'connection reset'.  That is what is happening here, the
read (attempting to read the 4 bytes that *all* packets start with)
fails, and samba notices that the connection has been reset.

Samba then cleans up, and exits.  

This could happen for any number of reasons, but basically there isn't
much Samba can do - the client closed the connection.   You need to look
at why the client has done this, particularly as clients normally don't
(they negotiate down the session, and normally keep a live connection to
the server).

At this point the standard answer is 'check your networking gear' and
'grab a sniffer'.  See if you can find evidence of lost packets,
retransmits or other things that could cause the client to think the
server had timed out.  

For information on the CIFS protocol, see
http://www.ubiqx.org/cifs/index.html

For a *very* good sniffer see http://www.ethereal.com

Andrew Bartlett

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba/attachments/20021110/b63b0126/attachment.bin


More information about the samba mailing list