more RPC patchery

Ronan Waide waider at waider.ie
Mon May 5 11:11:29 GMT 2003


I'm spending way too long staring at RPC traces, but this fix is both
short and effective. From observation, it appears that the larger
MAX_PDU_FRAG_LEN is used between systems advertising the raw pipe
stuff I'm so keen on playing with. If this isn't advertised
(e.g. Win2k) then the smaller value is used. Additionally, it seems
like you're confined to one PDU per WriteAndX, i.e. you can't split
your PDU over multiple WriteAndX requests. I've used Tim's rpc echo
stuff to verify that this works from a 1-byte RPC call up to a 16k RPC
call (after 16k I got bored and decided to use the machine for work
again...) I'd appreciate if anyone who's been having RPC-related
troubles could give this a whirl and see if it improves their
situation any, since my test network isn't huge.

Cheers,
Waider.

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   5 May 2003 11:03:34 -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       5 May 2003 11:03:34 -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) {
-- 
waider at waider.ie / Yes, it /is/ very personal of me.
"Even buddy can be hard after a few beers.  You start wondering if there's two
 "d's" or one and if it's "ie" or "y". That's why we came up with: Dude! 
 Although sometimes we end up calling each other "dud"." - Chuck O'Bryan


More information about the samba-technical mailing list