Bug 68 - Large RPC calls fail
Summary: Large RPC calls fail
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.0.0preX
Hardware: All Linux
: P1 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-06 03:25 UTC by Waider
Modified: 2005-11-14 09:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Waider 2003-05-06 03:25:47 UTC
RPC calls which require writing more than 5648 bytes of data fail. This is a
problem for example issuing an enumprinters call to a server with a large number
of printers.

Suggested fixes:
From observation between windows machines, the smaller maximum PDU fragment size
mentioned in rpc_dce.h (4280 bytes) is used when either machine does not offer
raw pipe writing capability. Further observation indicates that in the absence
of raw pipe writes, it is not permissible to split a PDU across separate
WriteAndX requests. Thus in the absence of raw pipe support (which I can provide
code for) the smaller MAX_PDU_FRAG_LEN should be used, and cli_write should be
modified to ensure that the block size is large enough to contain the PDU
fragment in its entirety.

Note, I do not know the origin of the calculation in cli_write. It does not
appear to correlate with anything I've observed in Windows traffic.

Patch against SAMBA_3_0 CVS as of May 6:
Index: include/rpc_dce.h
===================================================================
RCS file: /cvsroot/samba/source/include/rpc_dce.h,v
retrieving revision 1.22.2.7
diff -u -r1.22.2.7 rpc_dce.h
--- include/rpc_dce.h   16 Apr 2003 15:39:57 -0000      1.22.2.7
+++ include/rpc_dce.h   6 May 2003 10:23:51 -0000
@@ -63,7 +63,8 @@
 #define NETLOGON_NEG_SCHANNEL    0x40000000
 
 /* Maximum PDU fragment size. */
-#define MAX_PDU_FRAG_LEN 0x1630
+/* #define MAX_PDU_FRAG_LEN 0x1630 */
+#define MAX_PDU_FRAG_LEN 0x10b8
 /* #define MAX_PDU_FRAG_LEN 0x10b8             this is what w2k sets */
 
 /*
Index: libsmb/clireadwrite.c
===================================================================
RCS file: /cvsroot/samba/source/libsmb/clireadwrite.c,v
retrieving revision 1.16.2.7
diff -u -r1.16.2.7 clireadwrite.c
--- libsmb/clireadwrite.c       15 Jan 2003 18:57:39 -0000      1.16.2.7
+++ libsmb/clireadwrite.c       6 May 2003 10:23:51 -0000
@@ -326,7 +326,7 @@
        int issued = 0;
        int received = 0;
        int mpx = MAX(cli->max_mux-1, 1);
-       int block = (cli->max_xmit - (smb_size+32)) & ~1023;
+       int block = cli->max_xmit - (smb_size+32);
        int blocks = (size + (block-1)) / block;
 
        while (received < blocks) {
Comment 1 Tim Potter 2003-06-24 00:05:44 UTC
Waider, did jeremy apply your patch for this already?
Comment 2 Waider 2003-06-24 01:49:39 UTC
Doesn't appear to have, no.
Comment 3 Jeremy Allison 2003-08-11 10:43:46 UTC
I have checked this code in after testing with rpcecho.
Thanks Tim !
Jeremy.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2005-02-07 07:54:59 UTC
originally reported against 3.0alpha23.  Bugzilla spring cleaning.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:25:00 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:28:51 UTC
database cleanup