Fix from HEAD to set the parameter offset field correctly when first
authorJeremy Allison <jra@samba.org>
Tue, 28 Mar 2000 02:20:17 +0000 (02:20 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 28 Mar 2000 02:20:17 +0000 (02:20 +0000)
returning params.
Jeremy.

WHATSNEW.txt
source/smbd/trans2.c

index 45ddba692d4547d7f7fb0677c67176aedfcdc6b4..5cb5135d06c141844ac58df25bfe25d034e8edaa 100644 (file)
@@ -205,6 +205,9 @@ from Christoph Pfisterer.
 being sent to the wrong IP address.
 55). Fixed "recursion desired" bits set in nmbd so we are identical to
 Windows NT.
+56). nmbd now should process logon packets from Win95, Win98 and both
+versions of the NT logon packet.
+57). Correctly set parameter offset value for first trans2 reply.
 
 Older release notes for Samba 2.0.x follow.
 
index 2af7c0e7907364290f983cb4e92f24353d0ab315..b94d4ed581ccecf4beba2382c819ed430ce2d59c 100644 (file)
@@ -118,21 +118,19 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params,
     data_sent_thistime = MIN(data_sent_thistime,data_to_send);
 
     SSVAL(outbuf,smb_prcnt, params_sent_thistime);
+
+    /* smb_proff is the offset from the start of the SMB header to the
+       parameter bytes, however the first 4 bytes of outbuf are
+       the Netbios over TCP header. Thus use smb_base() to subtract
+       them from the calculation */
+
+    SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf)));
+
     if(params_sent_thistime == 0)
-    {
-      SSVAL(outbuf,smb_proff,0);
       SSVAL(outbuf,smb_prdisp,0);
-    }
     else
-    {
-      /* smb_proff is the offset from the start of the SMB header to the
-         parameter bytes, however the first 4 bytes of outbuf are
-         the Netbios over TCP header. Thus use smb_base() to subtract
-         them from the calculation */
-      SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf)));
       /* Absolute displacement of param bytes sent in this packet */
       SSVAL(outbuf,smb_prdisp,pp - params);
-    }
 
     SSVAL(outbuf,smb_drcnt, data_sent_thistime);
     if(data_sent_thistime == 0)