diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-06-08 11:17:08 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-06-11 10:29:18 +0200 |
commit | b0039d6972f631ca7fdff2379d50ad31c3781a7d (patch) | |
tree | 2e023cd490a89e608d484755b716f03f2fdfeeb4 | |
parent | 306d763d872bae2a1cc23fe13b769cace8198a3a (diff) |
device: fix net_rcv_msg-messages
Previously, all net_rcv_msg-messages sent by net_deliver were
malformed. It never was a problem in practice, since the messages are
not complex and thus the kernel does not try to parse the message.
struct net_rcv_msg contains an additional field of type boolean_t.
This field has no associated type descriptor, so it must not be
included in the message.
* device/net_io.c (net_deliver): Account for the extra field in the
msgh_size calculation.
-rw-r--r-- | device/net_io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/device/net_io.c b/device/net_io.c index 82b6fb9..a9d318e 100644 --- a/device/net_io.c +++ b/device/net_io.c @@ -467,6 +467,7 @@ boolean_t net_deliver(boolean_t nonblocking) /* remember message sizes must be rounded up */ kmsg->ikm_header.msgh_size = (((mach_msg_size_t) (sizeof(struct net_rcv_msg) + - sizeof net_kmsg(kmsg)->sent - NET_RCV_MAX + count)) + 3) &~ 3; kmsg->ikm_header.msgh_local_port = MACH_PORT_NULL; kmsg->ikm_header.msgh_kind = MACH_MSGH_KIND_NORMAL; |