X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/91447636331957f3d9b5ca5b508f07c526b0074d..c0fea4742e91338fffdcf79f86a7c1d5e2b97eb1:/osfmk/ipc/mach_msg.c?ds=inline diff --git a/osfmk/ipc/mach_msg.c b/osfmk/ipc/mach_msg.c index f532b5230..7600f56ec 100644 --- a/osfmk/ipc/mach_msg.c +++ b/osfmk/ipc/mach_msg.c @@ -582,6 +582,7 @@ mach_msg_overwrite_trap( mach_port_name_t notify = args->notify; mach_vm_address_t rcv_msg_addr = args->rcv_msg; mach_msg_size_t scatter_list_size = 0; /* NOT INITIALIZED - but not used in pactice */ + mach_port_seqno_t temp_seqno = 0; register mach_msg_header_t *hdr; mach_msg_return_t mr = MACH_MSG_SUCCESS; @@ -1488,7 +1489,6 @@ mach_msg_overwrite_trap( slow_copyin: { - mach_port_seqno_t temp_seqno = 0; register mach_port_name_t reply_name = (mach_port_name_t)hdr->msgh_local_port; @@ -1581,7 +1581,6 @@ mach_msg_overwrite_trap( { register ipc_port_t reply_port; - mach_port_seqno_t local_seqno; spl_t s; /* @@ -1658,7 +1657,7 @@ mach_msg_overwrite_trap( * no threads blocked waiting to send. */ dest_port = reply_port; - local_seqno = rcv_mqueue->imq_seqno++; + temp_seqno = rcv_mqueue->imq_seqno++; imq_unlock(rcv_mqueue); splx(s); @@ -1670,7 +1669,7 @@ mach_msg_overwrite_trap( ip_check_unlock(reply_port); if (option & MACH_RCV_TRAILER_MASK) { - trailer->msgh_seqno = local_seqno; + trailer->msgh_seqno = temp_seqno; trailer->msgh_trailer_size = REQUESTED_TRAILER_SIZE(option); } /* copy out the kernel reply */ @@ -1755,6 +1754,7 @@ mach_msg_overwrite_trap( /* LP64support - have to compute real size as it would be received */ reply_size = ipc_kmsg_copyout_size(kmsg, current_map()) + REQUESTED_TRAILER_SIZE(option); + temp_seqno = trailer->msgh_seqno; if (rcv_size < reply_size) { if (msg_receive_error(kmsg, msg_addr, option, temp_seqno, space) == MACH_RCV_INVALID_DATA) {