[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v8 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content |
Date: |
Mon, 21 Oct 2019 14:54:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
Le 21/10/2019 à 13:48, Philippe Mathieu-Daudé a écrit :
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Tested-By: Guido Günther <address@hidden>
> ---
> v8: use tswap32 (lvivier)
> ---
> linux-user/strace.c | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index fd5596a640..5fa7748427 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -8,6 +8,7 @@
> #include <arpa/inet.h>
> #include <netinet/tcp.h>
> #include <linux/if_packet.h>
> +#include <linux/netlink.h>
> #include <sched.h>
> #include "qemu.h"
>
> @@ -398,6 +399,12 @@ print_sockaddr(abi_ulong addr, abi_long addrlen)
> gemu_log("}");
> break;
> }
> + case AF_NETLINK: {
> + struct target_sockaddr_nl *nl = (struct target_sockaddr_nl *)sa;
> + gemu_log("{nl_family=AF_NETLINK,nl_pid=%u,nl_groups=%u}",
> + tswap32(nl->nl_pid), tswap32(nl->nl_groups));
> + break;
> + }
> default:
> gemu_log("{sa_family=%d, sa_data={", sa->sa_family);
> for (i = 0; i < 13; i++) {
> @@ -424,6 +431,9 @@ print_socket_domain(int domain)
> case PF_INET:
> gemu_log("PF_INET");
> break;
> + case PF_NETLINK:
> + gemu_log("PF_NETLINK");
> + break;
> case PF_PACKET:
> gemu_log("PF_PACKET");
> break;
> @@ -473,6 +483,33 @@ print_socket_protocol(int domain, int type, int protocol)
> return;
> }
>
> + if (domain == PF_NETLINK) {
> + switch (protocol) {
> + case NETLINK_ROUTE:
> + gemu_log("NETLINK_ROUTE");
> + break;
> + case NETLINK_AUDIT:
> + gemu_log("NETLINK_AUDIT");
> + break;
> + case NETLINK_NETFILTER:
> + gemu_log("NETLINK_NETFILTER");
> + break;
> + case NETLINK_KOBJECT_UEVENT:
> + gemu_log("NETLINK_KOBJECT_UEVENT");
> + break;
> + case NETLINK_RDMA:
> + gemu_log("NETLINK_RDMA");
> + break;
> + case NETLINK_CRYPTO:
> + gemu_log("NETLINK_CRYPTO");
> + break;
> + default:
> + gemu_log("%d", protocol);
> + break;
> + }
> + return;
> + }
> +
> switch (protocol) {
> case IPPROTO_IP:
> gemu_log("IPPROTO_IP");
>
Reviewed-by: Laurent Vivier <address@hidden>
- [PATCH v8 0/9] linux-user: strace improvements, Philippe Mathieu-Daudé, 2019/10/21
- [PATCH v8 1/9] linux-user/strace: Display invalid pointer in print_timeval(), Philippe Mathieu-Daudé, 2019/10/21
- [PATCH v8 3/9] linux-user/strace: Improve settimeofday(), Philippe Mathieu-Daudé, 2019/10/21
- [PATCH v8 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content, Philippe Mathieu-Daudé, 2019/10/21
- Re: [PATCH v8 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content,
Laurent Vivier <=
- [PATCH v8 9/9] linux-user/syscall: Align target_sockaddr fields using ABI types, Philippe Mathieu-Daudé, 2019/10/21
- [PATCH v8 6/9] linux-user/strace: Add print_sockfd(), Philippe Mathieu-Daudé, 2019/10/21
- [PATCH v8 8/9] linux-user/strace: Let print_sockaddr() have a 'last' argument, Philippe Mathieu-Daudé, 2019/10/21
- [PATCH v8 4/9] linux-user/syscall: Introduce target_sockaddr_nl, Philippe Mathieu-Daudé, 2019/10/21