Le 19/01/2025 à 05:41, del...@kernel.org a écrit :
From: Helge Deller <del...@gmx.de>

Fixes those warnings:
  Unsupported host ancillary data: 0/8

Signed-off-by: Helge Deller <del...@gmx.de>

v2: (based on feedback by Laurent Vivier)
- add target_in_pktinfo struct and fix copying target_in_addr fields
---
  linux-user/syscall.c      | 10 ++++++++++
  linux-user/syscall_defs.h |  6 ++++++
  2 files changed, 16 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a157abc40c..df8609b4d8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1998,6 +1998,16 @@ static inline abi_long host_to_target_cmsg(struct 
target_msghdr *target_msgh,
                      (void *) &errh->offender, sizeof(errh->offender));
                  break;
              }
+            case IP_PKTINFO:
+            {
+                struct in_pktinfo *pkti = data;
+                struct target_in_pktinfo *target_pi = target_data;
+
+                __put_user(pkti->ipi_ifindex, &target_pi->ipi_ifindex);
+                target_pi->ipi_spec_dst.s_addr = pkti->ipi_spec_dst.s_addr;
+                target_pi->ipi_addr.s_addr = pkti->ipi_addr.s_addr;
+                break;
+            }
              default:
                  goto unimplemented;
              }
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index faad9147c9..86d773add7 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2622,6 +2622,12 @@ struct target_ucred {
      abi_uint gid;
  };
+struct target_in_pktinfo {
+    abi_int               ipi_ifindex;
+    struct target_in_addr ipi_spec_dst;
+    struct target_in_addr ipi_addr;
+};
+
  typedef abi_int target_timer_t;
#define TARGET_SIGEV_MAX_SIZE 64

Reviewed-by: Laurent Vivier <laur...@vivier.eu>

Reply via email to