From: Dmitry V. Levin Date: Sun, 19 Jun 2016 22:02:45 +0000 (+0000) Subject: net.c: fix printing AF_IPX sockets X-Git-Tag: v4.13~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc4102e81d16c7fb90d9cb503f7c1c48dbc7b3f6;p=strace net.c: fix printing AF_IPX sockets * net.c (print_sockaddr): Print sockaddr_ipx as a regular structure. (SYS_FUNC(socket)): Remove special handling of AF_IPX. --- diff --git a/net.c b/net.c index 8b43444d..11d4a8aa 100644 --- a/net.c +++ b/net.c @@ -187,21 +187,20 @@ print_sockaddr(struct tcb *tcp, const sockaddr_buf_t *addr, const int addrlen) } break; #endif + case AF_IPX: { + tprintf("sipx_port=htons(%u)" + ", sipx_network=htonl(%08x)" + ", sipx_node=[", + ntohs(addr->sipx.sipx_port), + ntohl(addr->sipx.sipx_network)); int i; - tprintf("sipx_port=htons(%u), ", - ntohs(addr->sipx.sipx_port)); - /* Yes, I know, this does not look too - * strace-ish, but otherwise the IPX - * addresses just look monstrous... - * Anyways, feel free if you don't like - * this way.. :) - */ - tprintf("%08lx:", (unsigned long)ntohl(addr->sipx.sipx_network)); - for (i = 0; i < IPX_NODE_LEN; i++) - tprintf("%02x", addr->sipx.sipx_node[i]); - tprintf("/[%02x]", addr->sipx.sipx_type); + for (i = 0; i < IPX_NODE_LEN; ++i) { + tprintf("%s%02x", i ? ", " : "", + addr->sipx.sipx_node[i]); + } + tprintf("], sipx_type=%02x", addr->sipx.sipx_type); } break; @@ -775,21 +774,16 @@ SYS_FUNC(socket) printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???"); break; - case AF_IPX: - /* BTW: I don't believe this.. */ - tprints("["); - printxval(addrfams, tcp->u_arg[2], "AF_???"); - tprints("]"); - break; - case AF_NETLINK: printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???"); break; + #if defined(AF_BLUETOOTH) && defined(HAVE_BLUETOOTH_BLUETOOTH_H) case AF_BLUETOOTH: printxval(bt_protocols, tcp->u_arg[2], "BTPROTO_???"); break; #endif + default: tprintf("%lu", tcp->u_arg[2]); break;