[PATCH v3 1/2] linux-user: fix sockaddr_in6 endianness

2023-03-07 Thread Mathis Marion
From: Mathis Marion The sin6_scope_id field uses the host byte order, so there is a conversion to be made when host and target endianness differ. Signed-off-by: Mathis Marion --- linux-user/syscall.c | 5 + 1 file changed, 5 insertions(+) diff --git a/linux-user/syscall.c b/linux-user

[PATCH v3 2/2] linux-user: handle netlink flag NLA_F_NESTED

2023-03-07 Thread Mathis Marion
From: Mathis Marion Newer kernel versions require this flag to be present contrary to older ones. Depending on the libnl version it is added or not. Typically when using rtnl_link_inet6_set_addr_gen_mode, the netlink packet generated may contain the following attribute: with libnl 3.4

[PATCH v3 0/2] Missing endianness conversions in user mode

2023-03-07 Thread Mathis Marion
From: Mathis Marion For a bit of context, I was trying to test a network border router [1] daemon using the MIPS architecture (see [2]). I didn't have access to real MIPS hardware so I figured I would emulate it using QEMU user mode. I ran into a couple of problems all related to endia

Re: [PATCH v2 2/4] linux-user: fix sockaddr_in6 endianness

2023-03-07 Thread Mathis MARION
On 06/03/2023 22:52, Laurent Vivier wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. Le 20/02/2023 à 09:58, Mathis Marion a écrit : From: Mathis Marion Fields

Re: [PATCH v2 2/4] linux-user: fix sockaddr_in6 endianness

2023-02-20 Thread Mathis MARION
On 20/02/2023 10:06, Philippe Mathieu-Daudé wrote: CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. On 20/2/23 09:58, Mathis Marion wrote: From: Mathis Marion Fields

Re: [PATCH v1 3/4] linux-user: add target to host netlink conversions

2023-02-20 Thread Mathis MARION
On 20/02/2023 08:22, Philippe Mathieu-Daudé wrote: On 17/2/23 17:35, Mathis Marion wrote: From: Mathis Marion Added conversions for: - IFLA_MTU - IFLA_TXQLEN - IFLA_AF_SPEC AF_INET6 IFLA_INET6_ADDR_GEN_MODE These relate to the libnl functions rtnl_link_set_mtu, rtnl_link_set_txqlen, and

Re: [PATCH v2 4/4] linux-user: handle netlink flag NLA_F_NESTED

2023-02-20 Thread Mathis MARION
On 20/02/2023 09:58, Mathis Marion wrote: From: Mathis Marion Newer kernel versions require this flag to be present contrary to older ones. Depending on the libnl version it is added or not. Typically when using rtnl_link_inet6_set_addr_gen_mode, the netlink packet generated may contain the

[PATCH v2 3/4] linux-user: add target to host netlink conversions

2023-02-20 Thread Mathis Marion
From: Mathis Marion Added conversions for: - IFLA_MTU - IFLA_TXQLEN - IFLA_AF_SPEC AF_INET6 IFLA_INET6_ADDR_GEN_MODE These relate to the libnl functions rtnl_link_set_mtu, rtnl_link_set_txqlen, and rtnl_link_inet6_set_addr_gen_mode. Signed-off-by: Mathis Marion --- linux-user/fd-trans.c | 62

[PATCH v2 2/4] linux-user: fix sockaddr_in6 endianness

2023-02-20 Thread Mathis Marion
From: Mathis Marion Fields sin6_flowinfo and sin6_scope_id use the host byte order, so there is a conversion to be made when host and target endianness differ. Signed-off-by: Mathis Marion --- linux-user/syscall.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/linux-user/syscall.c

[PATCH v2 1/4] linux-user: fix timerfd read endianness conversion

2023-02-20 Thread Mathis Marion
From: Mathis Marion When reading the expiration count from a timerfd, the endianness of the 64bit value read is the one of the host, just as for eventfds. Signed-off-by: Mathis Marion --- linux-user/fd-trans.c | 10 +++--- linux-user/fd-trans.h | 1 + linux-user/syscall.c | 8

[PATCH v2 0/4] Missing endianness conversions in user mode

2023-02-20 Thread Mathis Marion
From: Mathis Marion For a bit of context, I was trying to test a network border router [1] daemon using the MIPS architecture (see [2]). I didn't have access to real MIPS hardware so I figured I would emulate it using QEMU user mode. I ran into a couple of problems all related to endia

[PATCH v2 4/4] linux-user: handle netlink flag NLA_F_NESTED

2023-02-20 Thread Mathis Marion
From: Mathis Marion Newer kernel versions require this flag to be present contrary to older ones. Depending on the libnl version it is added or not. Typically when using rtnl_link_inet6_set_addr_gen_mode, the netlink packet generated may contain the following attribute: with libnl 3.4

[PATCH v1 0/4] Missing endianness conversions in user mode

2023-02-17 Thread Mathis Marion
From: Mathis Marion For a bit of context, I was trying to test a network border router [1] daemon using the MIPS architecture (see [2]). I didn't have access to real MIPS hardware so I figured I would emulate it using QEMU user mode. I ran into a couple of problems all related to endia

[PATCH v1 4/4] linux-user: handle netlink flag NLA_F_NESTED

2023-02-17 Thread Mathis Marion
From: Mathis Marion Newer kernel versions require this flag to be present contrary to older ones. Depending on the libnl version it is added or not. Typically when using rtnl_link_inet6_set_addr_gen_mode, the netlink packet generated may contain the following attribute: with libnl 3.4

[PATCH v1 1/4] linux-user: fix timerfd read endianness conversion

2023-02-17 Thread Mathis Marion
From: Mathis Marion When reading the expiration count from a timerfd, the endianness of the 64bit value read is the one of the host, just as for eventfds. Signed-off-by: Mathis Marion --- linux-user/fd-trans.c | 10 +++--- linux-user/fd-trans.h | 1 + linux-user/syscall.c | 8

[PATCH v1 2/4] linux-user: fix sockaddr_in6 endianness

2023-02-17 Thread Mathis Marion
From: Mathis Marion Fields sin6_flowinfo and sin6_scope_id use the host byte order, so there is a conversion to be made when host and target endianness differ. Signed-off-by: Mathis Marion --- linux-user/syscall.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/linux-user/syscall.c

[PATCH v1 3/4] linux-user: add target to host netlink conversions

2023-02-17 Thread Mathis Marion
From: Mathis Marion Added conversions for: - IFLA_MTU - IFLA_TXQLEN - IFLA_AF_SPEC AF_INET6 IFLA_INET6_ADDR_GEN_MODE These relate to the libnl functions rtnl_link_set_mtu, rtnl_link_set_txqlen, and rtnl_link_inet6_set_addr_gen_mode. Signed-off-by: Mathis Marion --- linux-user/fd-trans.c | 64

[PATCH] linux-user: fix timerfd read endianness conversion

2023-02-08 Thread Mathis Marion
From: Mathis Marion When reading the expiration count from a timerfd, the endianness of the 64bit value read is the one of the host, just as for eventfds. Signed-off-by: Mathis Marion --- linux-user/fd-trans.c | 10 +++--- linux-user/fd-trans.h | 1 + linux-user/syscall.c | 8