From: John Hughes Date: Tue, 18 Sep 2001 15:56:53 +0000 (+0000) Subject: fix sockaddr display X-Git-Tag: v4.5.18~1013 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fcb1d64ed13836334d100af9412f220efa1bbfa;p=strace fix sockaddr display --- diff --git a/ChangeLog b/ChangeLog index 1e924e0e..f8c9be59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-09-18 John Hughes + + * net.c: fix display of sockaddr structures, sometimes too many "}", + sometimes too few. Fix suggested by Richard Kettlewell. + 2001-08-19 Wichert Akkerman * signal.c: do not include asm/sigcontext.h on IA64 since it gets diff --git a/net.c b/net.c index 2e312f23..0cbf48e2 100644 --- a/net.c +++ b/net.c @@ -613,7 +613,7 @@ int addrlen; return; } - tprintf("{sin_family="); + tprintf("{sa_family="); printxval(addrfams, addrbuf.sa.sa_family, "AF_???"); tprintf(", "); @@ -628,7 +628,7 @@ int addrlen; } break; case AF_INET: - tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")}", + tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")", ntohs(addrbuf.sin.sin_port), inet_ntoa(addrbuf.sin.sin_addr)); break; #ifdef HAVE_INET_NTOP @@ -663,7 +663,7 @@ int addrlen; case AF_IPX: { int i; - tprintf("{sipx_port=htons(%u), ", + tprintf("sipx_port=htons(%u), ", ntohs(addrbuf.sipx.sipx_port)); /* Yes, I know, this does not look too * strace-ish, but otherwise the IPX @@ -703,7 +703,7 @@ int addrlen; AF_X25 AF_ROSE etc. still need to be done */ default: - tprintf("{sa_family=%u, sa_data=", addrbuf.sa.sa_family); + tprintf("sa_data="); printstr(tcp, (long) &((struct sockaddr *) addr)->sa_data, sizeof addrbuf.sa.sa_data); break;