diff options
author | Łukasz Stelmach <l.stelmach@samsung.com> | 2025-08-27 11:54:12 +0200 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-28 07:33:34 +1000 |
commit | a5fbf1c617c5b51082d317601e0d4cf5eea5c140 (patch) | |
tree | 24f3abc3b92d1462484f32a62d8d43ec7ec9b011 | |
parent | f91563d011a0439cd6709e169cdfac268779d562 (diff) | |
download | qemu-a5fbf1c617c5b51082d317601e0d4cf5eea5c140.zip qemu-a5fbf1c617c5b51082d317601e0d4cf5eea5c140.tar.gz qemu-a5fbf1c617c5b51082d317601e0d4cf5eea5c140.tar.bz2 |
linux-user: do not print IP socket options by default
IP protocols should not be printed unless the socket is an IPv4 or
IPv6 one. Current arrangement erroneously prints IPPROTO_IP for Unix
domain sockets.
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250827095412.2348821-1-l.stelmach@samsung.com>
-rw-r--r-- | linux-user/strace.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c index 3b744cc..7863546 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -586,23 +586,27 @@ print_socket_protocol(int domain, int type, int protocol) return; } - switch (protocol) { - case IPPROTO_IP: - qemu_log("IPPROTO_IP"); - break; - case IPPROTO_TCP: - qemu_log("IPPROTO_TCP"); - break; - case IPPROTO_UDP: - qemu_log("IPPROTO_UDP"); - break; - case IPPROTO_RAW: - qemu_log("IPPROTO_RAW"); - break; - default: - qemu_log("%d", protocol); - break; + if (domain == AF_INET || domain == AF_INET6) { + switch (protocol) { + case IPPROTO_IP: + qemu_log("IPPROTO_IP"); + break; + case IPPROTO_TCP: + qemu_log("IPPROTO_TCP"); + break; + case IPPROTO_UDP: + qemu_log("IPPROTO_UDP"); + break; + case IPPROTO_RAW: + qemu_log("IPPROTO_RAW"); + break; + default: + qemu_log("%d", protocol); + break; + } + return; } + qemu_log("%d", protocol); } |