s4:rpc_server netgotiate max xmit size with RPC client
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Sep 2009 05:00:45 +0000 (22:00 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Sep 2009 14:18:16 +0000 (07:18 -0700)
Testing against NetAPP showed that clients can object to being told a
larger max xmit fragment size than they negotiated.  Choose the
minimum of the server and client values.

Andrew Bartlett

source4/rpc_server/dcerpc_server.c

index b529e605c59b398de4a2a1526bd164d65a1fbafc..f2402605d94b9e8b3c8490c6444d385fe66d4cc1 100644 (file)
@@ -636,7 +636,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
        }
 
        if (call->conn->cli_max_recv_frag == 0) {
        }
 
        if (call->conn->cli_max_recv_frag == 0) {
-               call->conn->cli_max_recv_frag = call->pkt.u.bind.max_recv_frag;
+               call->conn->cli_max_recv_frag = MIN(0x2000, call->pkt.u.bind.max_recv_frag);
        }
 
        if ((call->pkt.pfc_flags & DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN) &&
        }
 
        if ((call->pkt.pfc_flags & DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN) &&
@@ -658,7 +658,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
        pkt.call_id = call->pkt.call_id;
        pkt.ptype = DCERPC_PKT_BIND_ACK;
        pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST | extra_flags;
        pkt.call_id = call->pkt.call_id;
        pkt.ptype = DCERPC_PKT_BIND_ACK;
        pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST | extra_flags;
-       pkt.u.bind_ack.max_xmit_frag = 0x2000;
+       pkt.u.bind_ack.max_xmit_frag = call->conn->cli_max_recv_frag;
        pkt.u.bind_ack.max_recv_frag = 0x2000;
 
        /*
        pkt.u.bind_ack.max_recv_frag = 0x2000;
 
        /*