blob: 1d158b7f6699d883142e41541201a028f660f0f7 [file] [log] [blame]
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +00001/*
2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
6 * Copyright (c) 2005-2016 Dmitry V. Levin <ldv@altlinux.org>
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include "defs.h"
33#include "msghdr.h"
34#include <arpa/inet.h>
35#include <netinet/in.h>
36
37#include "xlat/msg_flags.h"
38#include "xlat/scmvals.h"
39#include "xlat/ip_cmsg_types.h"
40
41#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
42struct cmsghdr32 {
43 uint32_t cmsg_len;
44 int cmsg_level;
45 int cmsg_type;
46};
47#endif
48
49typedef union {
50 char *ptr;
51 struct cmsghdr *cmsg;
52#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
53 struct cmsghdr32 *cmsg32;
54#endif
55} union_cmsghdr;
56
57static void
Dmitry V. Levinb7937bd2016-06-30 22:39:02 +000058print_scm_rights(struct tcb *tcp, const void *cmsg_data, const size_t data_len)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000059{
60 const int *fds = cmsg_data;
Dmitry V. Levin029d9792016-06-30 22:20:56 +000061 const size_t nfds = data_len / sizeof(*fds);
62 size_t i;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000063
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +000064 tprints("[");
Dmitry V. Levin029d9792016-06-30 22:20:56 +000065
66 for (i = 0; i < nfds; ++i) {
67 if (i)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000068 tprints(", ");
Dmitry V. Levind35d5ec2016-07-02 21:14:26 +000069 if (abbrev(tcp) && i >= max_strlen) {
70 tprints("...");
71 break;
72 }
Dmitry V. Levin029d9792016-06-30 22:20:56 +000073 printfd(tcp, fds[i]);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000074 }
Dmitry V. Levin029d9792016-06-30 22:20:56 +000075
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000076 tprints("]");
77}
78
79static void
Dmitry V. Levinb7937bd2016-06-30 22:39:02 +000080print_scm_creds(struct tcb *tcp, const void *cmsg_data, const size_t data_len)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000081{
82 const struct ucred *uc = cmsg_data;
83
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +000084 tprintf("{pid=%u, uid=%u, gid=%u}",
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000085 (unsigned) uc->pid, (unsigned) uc->uid, (unsigned) uc->gid);
86}
87
88static void
89print_scm_security(struct tcb *tcp, const void *cmsg_data,
90 const size_t data_len)
91{
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +000092 print_quoted_string(cmsg_data, data_len, 0);
93}
94
95static void
96print_cmsg_ip_pktinfo(struct tcb *tcp, const void *cmsg_data,
97 const size_t data_len)
98{
99 const struct in_pktinfo *info = cmsg_data;
100
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000101 tprints("{ipi_ifindex=");
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000102 print_ifindex(info->ipi_ifindex);
Dmitry V. Levindb0e6e12016-06-29 22:07:20 +0000103 tprintf(", ipi_spec_dst=inet_addr(\"%s\")",
104 inet_ntoa(info->ipi_spec_dst));
105 tprintf(", ipi_addr=inet_addr(\"%s\")}",
106 inet_ntoa(info->ipi_addr));
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000107}
108
109static void
Dmitry V. Levinb7937bd2016-06-30 22:39:02 +0000110print_cmsg_uint(struct tcb *tcp, const void *cmsg_data, const size_t data_len)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000111{
Dmitry V. Levinb7937bd2016-06-30 22:39:02 +0000112 const unsigned int *p = cmsg_data;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000113
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000114 tprintf("[%u]", *p);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000115}
116
117static void
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000118print_cmsg_uint8_t(struct tcb *tcp, const void *cmsg_data,
119 const size_t data_len)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000120{
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000121 const uint8_t *p = cmsg_data;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000122
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000123 tprintf("[%#x]", *p);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000124}
125
126static void
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000127print_cmsg_ip_opts(struct tcb *tcp, const void *cmsg_data,
128 const size_t data_len)
129{
130 const unsigned char *opts = cmsg_data;
131 size_t i;
132
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000133 tprints("[");
Dmitry V. Levin2a897372016-06-28 22:25:10 +0000134 for (i = 0; i < data_len; ++i) {
135 if (i)
136 tprints(", ");
Dmitry V. Levin67135822016-07-02 21:14:48 +0000137 if (abbrev(tcp) && i >= max_strlen) {
138 tprints("...");
139 break;
140 }
Dmitry V. Levin2a897372016-06-28 22:25:10 +0000141 tprintf("0x%02x", opts[i]);
142 }
143 tprints("]");
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000144}
145
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000146struct sock_ee {
147 uint32_t ee_errno;
148 uint8_t ee_origin;
149 uint8_t ee_type;
150 uint8_t ee_code;
151 uint8_t ee_pad;
152 uint32_t ee_info;
153 uint32_t ee_data;
154 struct sockaddr_in offender;
155};
156
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000157static void
158print_cmsg_ip_recverr(struct tcb *tcp, const void *cmsg_data,
159 const size_t data_len)
160{
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000161 const struct sock_ee *const err = cmsg_data;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000162
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000163 tprintf("{ee_errno=%u, ee_origin=%u, ee_type=%u, ee_code=%u"
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000164 ", ee_info=%u, ee_data=%u, offender=",
165 err->ee_errno, err->ee_origin, err->ee_type,
166 err->ee_code, err->ee_info, err->ee_data);
167 print_sockaddr(tcp, &err->offender, sizeof(err->offender));
168 tprints("}");
169}
170
171static void
172print_cmsg_ip_origdstaddr(struct tcb *tcp, const void *cmsg_data,
173 const size_t data_len)
174{
Dmitry V. Levindfeea692016-06-30 22:26:35 +0000175 const int addr_len =
176 data_len > sizeof(struct sockaddr_storage)
177 ? sizeof(struct sockaddr_storage) : data_len;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000178
Dmitry V. Levindfeea692016-06-30 22:26:35 +0000179 print_sockaddr(tcp, cmsg_data, addr_len);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000180}
181
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000182typedef void (* const cmsg_printer)(struct tcb *, const void *, size_t);
183
184static const struct {
185 const cmsg_printer printer;
186 const size_t min_len;
187} cmsg_socket_printers[] = {
188 [SCM_RIGHTS] = { print_scm_rights, sizeof(int) },
189 [SCM_CREDENTIALS] = { print_scm_creds, sizeof(struct ucred) },
190 [SCM_SECURITY] = { print_scm_security, 1 }
191}, cmsg_ip_printers[] = {
192 [IP_PKTINFO] = { print_cmsg_ip_pktinfo, sizeof(struct in_pktinfo) },
193 [IP_TTL] = { print_cmsg_uint, sizeof(unsigned int) },
194 [IP_TOS] = { print_cmsg_uint8_t, 1 },
195 [IP_RECVOPTS] = { print_cmsg_ip_opts, 1 },
196 [IP_RETOPTS] = { print_cmsg_ip_opts, 1 },
197 [IP_RECVERR] = { print_cmsg_ip_recverr, sizeof(struct sock_ee) },
198 [IP_ORIGDSTADDR] = { print_cmsg_ip_origdstaddr, sizeof(struct sockaddr_in) },
199 [IP_CHECKSUM] = { print_cmsg_uint, sizeof(unsigned int) },
200 [SCM_SECURITY] = { print_scm_security, 1 }
201};
202
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000203static void
204print_cmsg_type_data(struct tcb *tcp, const int cmsg_level, const int cmsg_type,
205 const void *cmsg_data, const size_t data_len)
206{
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000207 const unsigned int utype = cmsg_type;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000208 switch (cmsg_level) {
209 case SOL_SOCKET:
210 printxval(scmvals, cmsg_type, "SCM_???");
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000211 if (utype < ARRAY_SIZE(cmsg_socket_printers)
212 && cmsg_socket_printers[utype].printer
213 && data_len >= cmsg_socket_printers[utype].min_len) {
214 tprints(", cmsg_data=");
215 cmsg_socket_printers[utype].printer(tcp, cmsg_data, data_len);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000216 }
217 break;
218 case SOL_IP:
219 printxval(ip_cmsg_types, cmsg_type, "IP_???");
Dmitry V. Levindf57a9b2016-06-30 22:49:36 +0000220 if (utype < ARRAY_SIZE(cmsg_ip_printers)
221 && cmsg_ip_printers[utype].printer
222 && data_len >= cmsg_ip_printers[utype].min_len) {
223 tprints(", cmsg_data=");
224 cmsg_ip_printers[utype].printer(tcp, cmsg_data, data_len);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000225 }
226 break;
227 default:
Dmitry V. Levin6c30aec2016-06-30 22:14:51 +0000228 tprintf("%#x", cmsg_type);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000229 }
230}
231
Dmitry V. Levinbf2698a2016-07-03 22:15:45 +0000232#ifndef UIO_MAXIOV
233# define UIO_MAXIOV 1024
234#endif
235
236static unsigned int
237get_optmem_max(void)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000238{
Dmitry V. Levinbf2698a2016-07-03 22:15:45 +0000239 static int optmem_max;
240
241 if (!optmem_max) {
242 if (read_int_from_file("/proc/sys/net/core/optmem_max",
243 &optmem_max) || optmem_max <= 0) {
244 optmem_max = sizeof(long long) * (2 * UIO_MAXIOV + 512);
245 } else {
246 optmem_max = (optmem_max + sizeof(long long) - 1)
247 & ~(sizeof(long long) - 1);
248 }
249 }
250
251 return optmem_max;
252}
253
254static void
255decode_msg_control(struct tcb *tcp, unsigned long addr,
256 const size_t in_control_len)
257{
258 if (!in_control_len)
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000259 return;
260 tprints(", msg_control=");
261
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000262 const size_t cmsg_size =
263#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
264 (current_wordsize < sizeof(long)) ? sizeof(struct cmsghdr32) :
265#endif
266 sizeof(struct cmsghdr);
267
Dmitry V. Levinbf2698a2016-07-03 22:15:45 +0000268 size_t control_len =
269 in_control_len > get_optmem_max()
270 ? get_optmem_max() : in_control_len;
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000271 size_t buf_len = control_len;
272 char *buf = buf_len < cmsg_size ? NULL : malloc(buf_len);
273 if (!buf || umoven(tcp, addr, buf_len, buf) < 0) {
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000274 printaddr(addr);
275 free(buf);
276 return;
277 }
278
279 union_cmsghdr u = { .ptr = buf };
280
281 tprints("[");
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000282 while (buf_len >= cmsg_size) {
283 const size_t cmsg_len =
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000284#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
285 (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_len :
286#endif
287 u.cmsg->cmsg_len;
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000288 const int cmsg_level =
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000289#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
290 (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_level :
291#endif
292 u.cmsg->cmsg_level;
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000293 const int cmsg_type =
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000294#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
295 (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_type :
296#endif
297 u.cmsg->cmsg_type;
298
299 if (u.ptr != buf)
300 tprints(", ");
301 tprintf("{cmsg_len=%lu, cmsg_level=", (unsigned long) cmsg_len);
302 printxval(socketlayers, cmsg_level, "SOL_???");
303 tprints(", cmsg_type=");
304
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000305 size_t len = cmsg_len > buf_len ? buf_len : cmsg_len;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000306
307 print_cmsg_type_data(tcp, cmsg_level, cmsg_type,
308 (const void *) (u.ptr + cmsg_size),
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000309 len > cmsg_size ? len - cmsg_size: 0);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000310 tprints("}");
311
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000312 if (len < cmsg_size) {
313 buf_len -= cmsg_size;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000314 break;
315 }
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000316 len = (cmsg_len + current_wordsize - 1) &
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000317 (size_t) ~(current_wordsize - 1);
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000318 if (len >= buf_len) {
319 buf_len = 0;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000320 break;
321 }
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000322 u.ptr += len;
323 buf_len -= len;
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000324 }
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000325 if (buf_len) {
326 tprints(", ");
327 printaddr(addr + (control_len - buf_len));
Dmitry V. Levinbf2698a2016-07-03 22:15:45 +0000328 } else if (control_len < in_control_len) {
329 tprints(", ...");
Dmitry V. Levin1d532102016-06-30 22:34:27 +0000330 }
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000331 tprints("]");
332 free(buf);
333}
334
Dmitry V. Levin7c37ce42016-07-14 22:13:58 +0000335void
336print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg,
337 const int *const p_user_msg_namelen,
338 const unsigned long data_size)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000339{
Dmitry V. Levind8f77cd2016-07-13 21:56:16 +0000340 const int msg_namelen =
341 p_user_msg_namelen && (int) msg->msg_namelen > *p_user_msg_namelen
342 ? *p_user_msg_namelen : (int) msg->msg_namelen;
Fabien Siron2850f742016-07-06 15:49:22 +0000343
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000344 tprints("{msg_name=");
Dmitry V. Levind8f77cd2016-07-13 21:56:16 +0000345 const int family =
346 decode_sockaddr(tcp, (long) msg->msg_name, msg_namelen);
347 const enum iov_decode decode =
348 (family == AF_NETLINK) ? IOV_DECODE_NETLINK : IOV_DECODE_STR;
349
350 tprints(", msg_namelen=");
351 if (p_user_msg_namelen && *p_user_msg_namelen != (int) msg->msg_namelen)
352 tprintf("%d->", *p_user_msg_namelen);
353 tprintf("%d", msg->msg_namelen);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000354
355 tprints(", msg_iov=");
Fabien Siron2850f742016-07-06 15:49:22 +0000356
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000357 tprint_iov_upto(tcp, (unsigned long) msg->msg_iovlen,
Fabien Siron2850f742016-07-06 15:49:22 +0000358 (unsigned long) msg->msg_iov, decode, data_size);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000359 tprintf(", msg_iovlen=%lu", (unsigned long) msg->msg_iovlen);
360
361 decode_msg_control(tcp, (unsigned long) msg->msg_control,
362 msg->msg_controllen);
363 tprintf(", msg_controllen=%lu", (unsigned long) msg->msg_controllen);
364
365 tprints(", msg_flags=");
366 printflags(msg_flags, msg->msg_flags, "MSG_???");
367 tprints("}");
368}
369
Dmitry V. Levindc84fa32016-07-14 22:26:28 +0000370static bool
Dmitry V. Levind8f77cd2016-07-13 21:56:16 +0000371fetch_msghdr_namelen(struct tcb *tcp, const long addr, int *const p_msg_namelen)
372{
373 struct msghdr msg;
374
375 if (addr && verbose(tcp) && fetch_struct_msghdr(tcp, addr, &msg)) {
376 *p_msg_namelen = msg.msg_namelen;
377 return true;
378 } else {
379 return false;
380 }
381}
382
Dmitry V. Levindc84fa32016-07-14 22:26:28 +0000383static void
Dmitry V. Levind8f77cd2016-07-13 21:56:16 +0000384decode_msghdr(struct tcb *tcp, const int *const p_user_msg_namelen,
385 const long addr, const unsigned long data_size)
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000386{
387 struct msghdr msg;
388
389 if (addr && verbose(tcp) && fetch_struct_msghdr(tcp, addr, &msg))
Dmitry V. Levin7c37ce42016-07-14 22:13:58 +0000390 print_struct_msghdr(tcp, &msg, p_user_msg_namelen, data_size);
Dmitry V. Levin95cce4f2016-06-27 00:02:55 +0000391 else
392 printaddr(addr);
393}
394
395void
396dumpiov_in_msghdr(struct tcb *tcp, long addr, unsigned long data_size)
397{
398 struct msghdr msg;
399
400 if (fetch_struct_msghdr(tcp, addr, &msg))
401 dumpiov_upto(tcp, msg.msg_iovlen, (long)msg.msg_iov, data_size);
402}
Dmitry V. Levindc84fa32016-07-14 22:26:28 +0000403
404SYS_FUNC(sendmsg)
405{
406 printfd(tcp, tcp->u_arg[0]);
407 tprints(", ");
408 decode_msghdr(tcp, 0, tcp->u_arg[1], (unsigned long) -1L);
409 /* flags */
410 tprints(", ");
411 printflags(msg_flags, tcp->u_arg[2], "MSG_???");
412
413 return RVAL_DECODED;
414}
415
416SYS_FUNC(recvmsg)
417{
418 int msg_namelen;
419
420 if (entering(tcp)) {
421 printfd(tcp, tcp->u_arg[0]);
422 tprints(", ");
423 if (fetch_msghdr_namelen(tcp, tcp->u_arg[1], &msg_namelen)) {
Dmitry V. Levinb759d272016-07-15 16:08:19 +0000424 set_tcb_priv_ulong(tcp, msg_namelen);
Dmitry V. Levindc84fa32016-07-14 22:26:28 +0000425 return 0;
426 }
427 printaddr(tcp->u_arg[1]);
428 } else {
Dmitry V. Levinb759d272016-07-15 16:08:19 +0000429 msg_namelen = get_tcb_priv_ulong(tcp);
Dmitry V. Levindc84fa32016-07-14 22:26:28 +0000430
431 if (syserror(tcp))
432 tprintf("{msg_namelen=%d}", msg_namelen);
433 else
434 decode_msghdr(tcp, &msg_namelen, tcp->u_arg[1],
435 tcp->u_rval);
436 }
437
438 /* flags */
439 tprints(", ");
440 printflags(msg_flags, tcp->u_arg[2], "MSG_???");
441
442 return RVAL_DECODED;
443}