Enhance diagnostics of address truncation in sockname family syscalls
* net.c (decode_sockname): Print both user and kernel address lengths
when the returned address is truncated.
* tests/sun_path.expected: Update expected output.
diff --git a/net.c b/net.c
index 86d93fc..245cae9 100644
--- a/net.c
+++ b/net.c
@@ -225,7 +225,10 @@
tprintf(", [%d]", ulen);
} else {
decode_sockaddr(tcp, tcp->u_arg[1], ulen > rlen ? rlen : ulen);
- tprintf(", [%d]", rlen);
+ if (ulen < rlen)
+ tprintf(", [%d->%d]", ulen, rlen);
+ else
+ tprintf(", [%d]", rlen);
}
return RVAL_DECODED;