[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 23/23] XXX i broke rpctrace
From: |
Justus Winter |
Subject: |
[PATCH 23/23] XXX i broke rpctrace |
Date: |
Fri, 29 Nov 2013 01:03:51 +0100 |
If we cannot get this to work with protected payloads, we can always
add a switch to libports to disable the optimization.
---
utils/rpctrace.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index ef7ab53..035a3fd 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1213,7 +1213,25 @@ trace_and_forward (mach_msg_header_t *inp,
mach_msg_header_t *outp)
/* Look up our record for the receiving port. There is no need to check
the class, because our port bucket only ever contains one class of
ports (traced_class). */
- info = ports_lookup_port (traced_bucket, inp->msgh_local_port, 0);
+
+ if (MACH_MSGH_BITS_LOCAL (inp->msgh_bits) == MACH_MSG_TYPE_PROTECTED_PAYLOAD)
+ {
+ info = (struct traced_info *) inp->msgh_protected_payload;
+ if (info && info->pi.bucket == traced_bucket)
+ {
+ ports_port_ref (info);
+ /* Undo the protected payload optimization for our tracee. */
+ inp->msgh_bits = MACH_MSGH_BITS (
+ MACH_MSGH_BITS_REMOTE (inp->msgh_bits),
+ MACH_MSG_TYPE_PORT_SEND); /* XXX we cannot know the real type :( */
+ inp->msgh_local_port = ports_payload_get_name (info);
+ }
+ else
+ info = NULL;
+ }
+ else
+ info = ports_lookup_port (traced_bucket, inp->msgh_local_port, 0);
+
assert (info);
/* A notification message from the kernel appears to have been sent
--
1.7.10.4
- [PATCH 11/23] pfinet: add a payload-aware intrans functions, (continued)
- [PATCH 11/23] pfinet: add a payload-aware intrans functions, Justus Winter, 2013/11/28
- [PATCH 13/23] auth: add a payload-aware intrans function, Justus Winter, 2013/11/28
- [PATCH 12/23] pflocal: add a payload-aware intrans functions, Justus Winter, 2013/11/28
- [PATCH 14/23] trans: add a payload-aware intrans function to password, Justus Winter, 2013/11/28
- [PATCH 15/23] proc: add a payload-aware intrans function, Justus Winter, 2013/11/28
- [PATCH 17/23] trans: disable default payload to port mapping in fsysServer.c, Justus Winter, 2013/11/28
- [PATCH 16/23] init: disable default payload to port mapping, Justus Winter, 2013/11/28
- [PATCH 18/23] libports: add ports_payload_get_name, Justus Winter, 2013/11/28
- [PATCH 19/23] hurd: add intranpayload functions to all hurd types, Justus Winter, 2013/11/28
- [PATCH 22/23] Fix build, Justus Winter, 2013/11/28
- [PATCH 23/23] XXX i broke rpctrace,
Justus Winter <=
- [PATCH 21/23] XXX libports: clear payload prior to port destruction, Justus Winter, 2013/11/28
- [PATCH 20/23] libports: use protected payloads to optimize the object lookup, Justus Winter, 2013/11/28