]> granicus.if.org Git - strace/commitdiff
net.c: fix printing AF_IPX sockets
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 19 Jun 2016 22:02:45 +0000 (22:02 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 19 Jun 2016 22:02:45 +0000 (22:02 +0000)
* net.c (print_sockaddr): Print sockaddr_ipx as a regular structure.
(SYS_FUNC(socket)): Remove special handling of AF_IPX.

net.c

diff --git a/net.c b/net.c
index 8b43444d273b076a89d1218033fd629209590300..11d4a8aabdb72dcedd79d605d188c4570041f7ef 100644 (file)
--- 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;