in allocate pdu, if context is udp, dont allocate space for a record marker
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 26 Jun 2011 07:30:00 +0000 (17:30 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 26 Jun 2011 07:30:00 +0000 (17:30 +1000)
lib/pdu.c

index fb03061c5a3192664aaddeb60b259854d73c8f62..a12d30b2501e342a9d76fa91102521b973b668c7 100644 (file)
--- a/lib/pdu.c
+++ b/lib/pdu.c
@@ -48,7 +48,9 @@ struct rpc_pdu *rpc_allocate_pdu(struct rpc_context *rpc, int program, int versi
        pdu->xdr_decode_bufsize = xdr_decode_bufsize;
 
        xdrmem_create(&pdu->xdr, rpc->encodebuf, rpc->encodebuflen, XDR_ENCODE);
-       xdr_setpos(&pdu->xdr, 4); /* skip past the record marker */
+       if (rpc->is_udp == 0) {
+               xdr_setpos(&pdu->xdr, 4); /* skip past the record marker */
+       }
 
        bzero(&msg, sizeof(struct rpc_msg));
        msg.rm_xid = pdu->xid;