From aaa8aadd35dcdba542bda897bfe6c55c1567714b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Mar 2000 02:20:57 +0000 Subject: Moved common code to set parameter offset field correctly oout of 'if' statement into main function code path. Jeremy. (This used to be commit f15ca0d9273d718534ba2fdd2ccd14ab90a95c8b) --- source3/smbd/trans2.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'source3') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 24abf60a79..38f2802df3 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf))); 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) -- cgit